You enter your name in the Goblet of Fire, you’re required to compete in the Triwizard Tournament (until death, in the old days!). You sign a lease agreement, you’re required to pay rent or suffer legal consequences, like being evicted in some cases.
You can’t terminate your entry into the Triwizard Tournament. Like you can’t terminate a rental agreement before its time (more than likely).
You’re setting yourself up for risks, like death, in the Triwizard Tournament, putting your trust in something bigger than yourself. Same thing with a rental agreement. Landlords and the companies that invest in tenant housing are all you can trust, and that’s definitely not always comforting.
The Triwizard Tournament has a Yule Ball. And in your apartment/townhome/place you have parties. (Maybe, with a certain limit to people and noise.)
Cedric and Harry had to use the prefects’ bathroom in order to figure out their eggs. You have to use your bathroom in order to figure out what’s making that weird noise in the plumbing without calling your landlord and/or wasting money on a plumber.
The dragons in the first task are like your landlords: it’s like you pick them out of a bag, and you don’t really know who they are or how they act until you meet them and sign an agreement. (Luckily not all are like dragons themselves!)
The merpeople in the second task are like your neighbors: nosy at who you are, occasionally snotty, and very territorial. Watch out and be courteous, and you can maybe be friends.
The third task’s maze is much like the shape of your home before you hear about a landlord inspection: impossible to navigate and hiding objects of great interest, like secret attics, holes in the wall, etc.
At the end, if you win the Triwizard Tournament, you receive the Triwizard Cup! At the end of a lease, you get your security deposit back.