Tonight's series finale opened with House lying on the ground next to a man, presumably dead. It takes place right after the last episode where House is still coping with Wilson's illness and his parole being revoked. As House lies on the floor of the building, House hallucinates Kutner appearing and from that point on, House describes his experience with this particular dead patient and how he came to be in this burning building.
The patient is a heroin addict and chooses drugs and death over the reality of his life. And for the next 40 minutes or so of the episode, House imagines speaking to Amber, Stacy, and Cameron, all important women of his past about whether to fight through the fire or if he would be happier just to give up and die. As each takes a turn in offering an opinion, which is really House's subconscious, House finally realizes he should get up and fight.
Meanwhile, Wilson and Foreman realize House is missing and track him down to the burning building where an explosion occurs! In the next scene, it's House's funeral and a number of former team members were there including Cameron, Thirteen, and Masters. Stacy and House's mother were also in attendance. As Wilson gets up to eulogize his friend, he receives a text that says "Shut up, you idiot" and Wilson goes to his House and finds House waiting for him.
House faked his own death in order to spend time with Wilson in his last five months. Doing that for Wilson means House giving up medicine and potentially going to jail for years in the future. The series ended with a montage. We see Taub happy with his kids, Foreman discovering House's badge and realizing he's still alive, Chase taking over as the head of the Diagnostic Department, and Cameron staring wistfully at her old team as we see her new husband and child come by her hospital and pick her up from work. And finally, House and Wilson, each on their own motorcycle, ride off together.