You found your dream house, and you're about to sign the contract of sale when the seller hits you with an odd request. He wants to stay in the house after the closing.

It's a common occurrence, says Linda Sanderfoot, a real estate agent at Coldwell Banker in Neenah, Wis. There's a shortage of homes on the market in many parts of the U.S., and there hasn't been much new residential construction in recent years, according to the National Association of Retailers.

"Sellers sometimes have nowhere to go," she says.

More on buying a home

For these reasons, buyers sometimes agree to let the seller stay on for a month or two after closing, Sanderfoot says. To do this, they sign a rent-back agreement where the buyer takes on the role of the landlord, and the seller becomes the tenant for a short period of time.

While the benefits are obvious for the seller, they are less so for the buyer. For one thing, you now need your own place to stay while someone else occupies your new home.

This may not be a big problem if you're currently renting. But if you had to sell your current home to buy the new one, a rent-back agreement might not make sense (unless you do your own rent-back). Also keep in mind that you still have to pay the mortgage on your new home even though you're not living there yet.

There are risks as well. The seller, for instance, might not vacate the house at the agreed-upon time or might leave the house in poor condition.

That said, there are cases where renting back your new home may make sense. The extra income, Sanderfoot says, can offset not only your mortgage payments but also some closing costs, such as broker commissions, appraisal fees, and attorney fees.

But before you agree to a rent-back, think carefully about the terms.

Here's what to consider.

Understand why the seller wants a rent-back agreement. It could be that the seller needs extra time to move—or may need the proceeds from the sale to purchase a new home. Understanding the situation will help you to determine the terms of the agreement.

Charge a fair price. Don't try to gouge the seller on rent. Jennifer Baxter, an associate broker at Coldwell Banker RMR in Suwanee, Ga., says you should charge the equivalent of what you'll be paying for your mortgage, which includes your principal, interest, taxes, and insurance. If the seller isn't going to stay in the home for a month or two full months, you can use a prorated rent calculator to determine how much to charge. Your best move: Collect the money up front, Baxter says.

Additionally, the lease agreement should spell out who is responsible for paying for utilities. Typically, the services remain in the seller's name until you take possession of the property, according to Baxter.

Don't sign a lease that lasts longer than 60 days. Like a standard lease, a rent-back agreement needs to stipulate when the tenant will vacate the property. If you agree that the seller will remain in the home for longer than 60 days after closing, the home will be considered an investment property by your mortgage lender, says Richard Redmond, broker at All California Mortgage in Larkspur, Calif. Because loans for investment properties have interest rates that can be up to 1.25 percent higher than a mortgage rate, setting a 60-day cap for the seller's stay is crucial.

Charge a holdover fee if the seller stays longer than agreed. Sanderfoot recommends charging the tenant an extra $100 per day spent in the home, but the amount can vary depending on where you live. This fee could help you to avoid evicting the seller, which is a time-consuming, often complicated process.

Collect a security deposit. This would offer you protection if the seller damages the property during the rental period.

Require renters insurance. The reason is that your homeowners insurance won't cover the tenant's belongings if there's damage, say, from a fire, Sanderfoot says. And if someone is hurt on the property, the renter will be responsible, not you.

Get a copy of the renters insurance policy prior to closing, and notify your insurance provider of the rent-back agreement—the company may need to adjust your policy, says Jeanne Salvatore of the Insurance Information Institute.