While Bart and Lisa are cleaning out the garage, they stumble across old home movies. One of the tapes they found has an old episode of the sitcom Perfect Strangers on it, followed by a commercial for a product called "Baby Stink-Breath"— with Bart as a baby with bad breath. Bart confronts Homer and Marge about the advertisement, who tells him that its revenue made a lot of money. However, Homer had ended up spending it all to buy back incriminating photos to avoid scandal. The next day, a furious Bart goes to a law firm named "Luvum and Burnham" Family Law, at Milhouse's suggestion. He meets the Blue Haired Lawyer there, and tells him that he wants a 'divorce' from his family.
The next day, during dinner, the Blue Haired Lawyer comes to the house to serve Homer with a subpoena. When the family discovers that Bart is suing them, they are shocked. He declares that he wants to be emancipated, much to Marge's horror and his father's rage. Homer defends himself by telling Bart that his father was terrible to him while he was growing up. However instead of suing him for emancipation, Homer got his revenge on Abe by dropping him off at a cheap nursing home.
At the trial, Bart's case is made clear in various ways, such as using a doll and Homer's anger issues. Despite acknowledging that Bart may be too young for emancipation, Judge Harm rules in his favor and declares him legally emancipated. She claims Homer's sociopathic behavior and abuse towards Bart as the main reason why his son should live on his own. As a result, Homer is forced to give up half his salary as his punishment for stealing Bart's money. Furious by this loss, Homer tries to attack Judge Harm, but the bailiff stops him and drags him away for contempt of court.
The next day, Bart rents up a loft near downtown. He prepares to leave and says tearful goodbyes to everyone (except Homer). Marge tries to convince him to stay, promising that she will let him swear in the house more. Bart refuses and tells Marge that she, Lisa and Maggie did nothing wrong. His problem has always been with Homer and now that Bart is emancipated, he's free from his father's abuse. Bart leaves in a taxi, which Homer chases down taunting him that he won't last on his own and will be coming back. However, as the taxi drives off, Homer breaks down sobbing in the middle of the road.
Bart's early experiences in the loft are rather scary due to its dangerous location, but he soon finds that Tony Hawk is living in the building and throwing a party with pop-punk band Blink-182. He and Hawk become friends, and he is content with his new life. Back at the Simpson house, Marge is still depressed about Bart being gone and convinces an equally desperate Homer to apologize to him. The family goes to meet him at his loft. He apologizes and asks to return home, promising to treat him better by paying back the money. Bart accepts the apology, but tells them that he is going on Tony Hawk's Skewed Tour.
At the event, Homer meets up with Hawk and pleads with him to pretend to lose to him so that he can make Bart proud of him again. Hawk reluctantly agrees and gives Homer a modified skateboard, which does all the stunt work. Later, Homer challenges Hawk to a skateboard match and does a good job, thanks to the skateboard. Hawk, unhappy about being shown up by Homer, decides to "take out the thrash". They duel with their skateboards in mid-air, and Tony falls to the ground. Homer speaks to Bart and finally promises that he will never mistreat him again. Lindsey Naegle approaches Homer and asks him to star in a commercial. Homer accepts so that he can get Bart fully repaid.
At the Simpson house, Homer is embarrassed when he watches the final product, an advertisement for an impotence drug, but Bart tells him that nobody will remember it in 50 years. Fifty years later, Homer is dead, and an elderly Nelson Muntz visits his grave to laugh at him.