"Home Sweet Pineapple" is episode 5b of SpongeBob SquarePants and was first aired on August 14, 1999. It is a Season 1 episode. In this episode, SpongeBob loses his house as it was drunk up by Nematodes.
A bunch of hungry Nematodes walk into Bikini Bottom, eating a coral and a truck. They then become thirsty and decide to drink up SpongeBob's house. SpongeBob and Gary wake up, and scream in peril realizing their house is disappearing. SpongeBob calls Squidward for help, but his shell phone shrinks before he could get any advice. Eventually SpongeBob's house completely disappears, and Squidward and Patrick walks over to SpongeBob, who states his house is gone and the only thing left of it is a little pebble. He also states that he's going have to move back with his parents, causing Squidward to walk back home and throw a party. Patrick stays with SpongeBob, and gives him the idea to build a new house.
A construction montage then shows up, showing Patrick repeatedly hitting himself with a nail, SpongeBob doing some plumbing, and SpongeBob doing some frame work as wood keeps hitting Patrick's hand. Eventually they are finished, but the house is too small for SpongeBob, and the house breaks. SpongeBob sadly says he's going have to move, but Patrick he can be rockmates with him.
At Patrick's rock at night, SpongeBob, Patrick, and Gary say goodnight to each other. However, just when SpongeBob is starting to sleep off, Patrick starts snoring loudly. SpongeBob then puts 2 corks in his holes and uses them as earplugs. It soon becomes windy and then SpongeBob and Patrick start fighting over the rock, which they used as a blanket. Patrick wins though and SpongeBob then makes a blanket out of sand. However Patrick starts drooling heavily and some of the drool is filling up Patrick's mouth. SpongeBob then puts a large cork in his mouth to stop the drooling. Eventually, he spits out the cork and starts slamming SpongeBob repeatedly with the rock. SpongeBob tries to sleep somewhere else, but Patrick's charade happens again.
SpongeBob goes to Squidward's house asking if he can sleep with him, which he initally in half-sleep agrees to. However, he full wakes up and realizing SpongeBob's sleeping with him, he kicks him out of his house.
It cuts to the day SpongeBob moves away, with Squidward there in excitement and Patrick there in sorrow. SpongeBob then buries the little pebble he has, and drops a tear on it. When Squidward sees SpongeBob get in his parent's car, he starts dancing on the ground where his house used to stand. However the little pebble SpongeBob buried was actually a seed, and a stalk grows, which grows SpongeBob's pineapple back, which falls on Squidward. SpongeBob and friends see this, and they happily run inside, and SpongeBob says to Squidward gladly he's staying forever.