Answer: The Mishna (Sukka 2:9) teaches us that if it rains enough to ruin one’s food then one may leave their sukka. While the Mishna writes that it is a bad sign if one has to leave due to rain, the Aruch Hashulchan (OC 639:20) writes that this specifically applies in Eretz Yisrael, but not in places where it is likely to rain. The Rema (OC 639:7) and Aruch Hashulchan write that one who stays in the sukka when they’re exempt is considered to be unrefined (See Teshuvos Vehanhagos 2:304).
Nonetheless, the Rema (OC 639:5) writes that this halacha doesn’t apply on the first night, as if it is raining then, one must still make kiddush and eat a kezayis of bread in the sukka. According to the Mateh Ephraim (625:51), one should ideally eat a kebeitza.
While one who is mitztaer (uncomfortable) is usually exempt from eating in the sukka, the Mishna Berura (639:35) explains that according to the Rema, this exemption doesn’t apply on the first night. Then, one is obligated to eat in the sukka even if they are somewhat uncomfortable, just like matza on seder night. As there are those who disagree with the Rema and hold that one who is mitztaer is exempt even on the first night, they shouldn’t recite leishev basukka so long as it is raining. One should, therefore, wait until the rain stops to fulfil this mitzva properly according to both views.
While the Magen Avraham (OC 639:15) writes that one should wait until chatzos for the rain to clear up if necessary, the Mishna Berura quotes the Shaarei Teshuva who writes that this is unnecessary, especially as having to wait so long can ruin one’s simchas Yom Tov. Rather, one should wait an hour or so, depending on whether one has young children or guests, etc.
The Magen Avraham writes that if it is raining on the second night, one can start the meal inside their house without having to wait for the rain to clear. One should eat a kezayis of bread in the sukka at the end of their meal, however. If it has stopped raining by then, then one should say the beracha, leishev basukka (See Shaar Hatziyun 639:73).
In conclusion, if it is raining on the first night of Sukkos, one should wait before starting their meal. How long they wait will depend on their circumstances, though they shouldn’t wait so long that it will ruin their simchas Yom Tov. When it is too late to wait any longer, they should recite kiddush and eat a kezayis of bread in the sukka without saying leishev, before closing the roof or going inside to continue the meal. If it does stop raining before chatzos, one should go back into the sukka to eat another kezayis of bread and say leishev, washing again if necessary.
If it rains throughout any other meal over sukkos then one should close the roof or go inside.