Sometimes the unexpected occurs and you have to move sooner than expected, says Ralph DiBugnara, real estate and mortgage expert and president of Home Qualified. But if you move too soon, you could pay a penalty.

If your home has appreciated in value and you’ve lived there for less than two years, you could be subject to what’s called “capital gains tax” on the profit.

After two years, however, many homeowners are exempt under the Taxpayer Relief Act of 1997. At this point, you can avoid paying capital gains taxes on the first $250,000 of profit (for single individuals), and up to $500,000 (for married couples).

Just note: Once you use this particular exemption to your benefit, you are barred from using it again for another two years.

But what if you’ve purchased an income property? “For mortgage purposes, you have to live in a new property for at least 12 months before you’re able to rent it,” says DiBugnara.

There are a few exceptions to that rule, though. “If you buy a home as a second home, you’re able to rent it seasonally. And if you buy a home and want to rent it as a short-term rental or something like that, you’re able to do that as long as it’s still an owner-occupied property.”

To ensure you don’t find yourself in a pickle, DiBugnara suggests doing a little homework before pulling the trigger on a house. “If I had children, I would check if there were upcoming changes to the school systems or districts,” he says. “I would also see if there’s any kind of commercial influence coming to the area. Anything being rezoned could impact your value in a negative way.”