During the entire week of the Sukkot festival, Jews have a special mitzvah to live in the Sukkah, in the same way that we live in our homes during the rest of the year (Mishnah - Sukkah 2:9). This means (where possible) bringing one's nice utensils, books, and even furnishings into the Sukkah. Here's some basic guidelines:
The obligation to eat in the Sukkah occurs whenever one eats a meal or snack consisting of a baked grain (as opposed to fruit or drink). When fulfilling this requirement, a person should recite the special blessing "layshev b'Sukkah" – "Blessed are You, Lord our God, King of the Universe, who sanctified us with His mitzvot, and instructed us to sit in the Sukkah." (O.C. 639:2,8)
Further, one is specifically obligated to eat bread in his Sukkah on the first night of the Sukkot holiday. This should be at least a k'beitza of bread – approximately 60g or two ounces (O.C. 639:3, M.B. 639:22).
One should also endeavor to study Torah in the Sukkah each day, and to sleep only in the Sukkah, even for a brief nap (O.C. 639:2,4).
Home Away From Home
The principle of "the Sukkah is like one's home" presents many situations in which one is actually exempt from dwelling in the Sukkah. For example, someone who is slightly ill need not sleep in the Sukkah, since he would not specifically stay in his usual home if a more comfortable location was available (O.C. 640:3, M.B. 640:6).
Similarly, one needn't sleep in the Sukkah if he is bothered by the cold (Rama, O.C. 639:2). A similar standard would apply to other discomforts such as insects or a foul odor, though one should not initially erect his Sukkah in a place in which such inconveniences are likely to occur (M.B. 639:31, O.C. 640:4).
Perhaps the most common question is what to do if it rains during Sukkot. As long as one would not normally leave his own house based on the amount his Sukkah is leaking, he should not leave his Sukkah either (Rama O.C. 639:5).
For sleeping, however, any amount of rain will excuse one from the Sukkah – because even a very slight leak typically irritates a person when trying to rest. By the way, anyone who is legitimately excused from the Sukkah but remains there anyway, does not fulfill any mitzvah nor receive reward, but is instead considered foolish (Rama O.C. 639:7).
Why does Jewish law allow for such exemptions?
The great Chassidic master, the Kotzker Rebbe, explains that the mystical meaning of Sukkah is the concept of "bitul" – the notion that to the extent one focuses on self, he impedes his connection to both other people and to God. This is why during Sukkot one is obliged to leave most of his worldly possessions and return to the basics – living with bare walls and surrounded by family, friends, and of course, the Almighty. However, someone who is consciously aware of his personal distress and cannot get beyond himself, is therefore unable to integrate the deeper meaning of Sukkot and is thus excused from the mitzvah.
There is one exception to all of these leniencies. On the first night of the holiday, one should eat at least a k'zayit (approx. 30g or one ounce) of bread in the Sukkah regardless of inclement weather. He should attempt to say all four blessings – Kiddush, Shehechiyanu, HaMotzei, and Layshev – before going back inside for the remainder of the festive meal. Also, if it looks like the rain will stop soon, he should wait an hour or two (Rama O.C. 639:5, M.B. 639:35,36).
The most important thing, beyond fulfilling the specific obligations of dwelling in the Sukkah, is to use this time to internalize the idea that the Almighty is always protecting us, just as He did when taking the Jews out of Egypt – protecting them with the Clouds of Glory (O.C. 625:1, M.B. 625:1).