(א) הַיָּשֵׁן תַּחַת הַמִּטָּה בַסֻּכָּה, לֹא יָצָא יְדֵי חוֹבָתוֹ.
(1)One who sleeps beneath the bed in the sukka did not fulfill his obligation.
רַבִּי יְהוּדָה אוֹמֵר, אִם אֵינָהּ יְכוֹלָה לַעֲמֹד בִּפְנֵי עַצְמָהּ, פְּסוּלָה.
[...]צִּלָּתָהּ מְרֻבָּה מֵחַמָּתָהּ, כְּשֵׁרָה.
Rabbi Judah says: if it cannot stand on its own, it is invalid.
[A sukkah] whose shade is more than its sun is valid.
הָעוֹשֶׂה סֻכָּתוֹ בְּרֹאשׁ הָעֲגָלָה אוֹ בְּרֹאשׁ הַסְּפִינָה, כְּשֵׁרָה, וְעוֹלִין לָהּ בְּיוֹם טוֹב.
בְּרֹאשׁ הָאִילָן אוֹ עַל גַּבֵּי גָמָל, כְּשֵׁרָה, וְאֵין עוֹלִין לָהּ בְּיוֹם טוֹב.
One who makes his sukkah on the top of a wagon, or on the deck of a ship, it is valid and one may go up into it on the festival.
If he made it on the top of a tree, or on the back of a camel, it is valid, but one may not go up into it on the festival.
Le-khatḥila it is better to build a sukka with four full walls and a door that can be closed, so the sukka is comfortable and provides shelter from the sun and wind (see Rema 630:5.) Technically, however, since a sukka is a temporary residence, it is not required to have four walls; three suffice. Moreover, the third wall need not be full; technically, one tefaḥ suffices. The Sages said that this tefaḥ must be within 3 tefaḥim of one of the other walls, and the one-tefaḥ wall must extend by means of a doorway (tzurat ha-petaḥ, explained in the note). Since this law is complicated, someone who wants to save on sukka walls should be advised to put up two complete walls, and a third one which is 7 tefaḥim long (about 56 centimeters). Then, even if his sukka is large, and even if the two walls aren’t connected to one another but rather face each other, the sukka is kosher (Rema 630:3).[9]
