The majority hold that it is forbidden to sleep for even a moment outside the sukkah. It is considered to be foolish to sleep in the sukkah if it's raining. However, all the sources I've found word this halakha along the lines of "if it begins to rain, then he should go inside". They don't seem to contemplate sleeping inside from the outset if it is forecasted to rain. Further, he is permitted to remain sleeping inside after the rain stops. So hypothetically, if one reasonably believed it would rain that night, may he sleep inside from the outset even though he would theoretically be comfortable in the sukkah at the time he goes to sleep if he is reasonably certain it will rain?
The Ritva' (Sukah 29a, s.v. ת"ר היה אוכל) says if one senses rain and a developing overcast ("shamayim miskadrim b'avim") you're patur from Sukah, under the same exemption as when it is actually raining -"mitztaer". This opinion was later relied upon by the Bikure Yaacov (639:30).
The question contemporary Poskim deal with is if this concept applies to weather reports; that is, if meteorologists forecast rain which is not yet detectable in the sky, and it affects you setting yourself up in the Sukah for some time, like a long meal or going to sleep. So, the halachic jury is still out on this one.....
Weather forecast are not always accurate and even when the predicted rain does come it may be delayed or possibly not fall in all the predicted locations equally. However if one believes in the accuracy of weather forecasts to the point that the predicted possibility of rain causes him discomfort and anxiety, he is exempt from sleeping in the suka.