If you are planning to sell your home in retirement, there is a major tax break that may be valuable to you, especially if you have owned it for long enough for it to appreciate significantly in value. That is a tax exclusion for all gains on a the sale of a primary residence, up to $500,000, as long as you’re married when you sell the house you’ve lived in during two of the previous five years. (Single homeowners get a $250,000 exemption.)

Therefore, you can buy a house for $100,000 and sell it eventually for up to $600,000 without owing a penny to the IRS. What’s more, you can take that $600,000, buy a new house for that amount, and eventually sell it for $1.1 million, tax-free.

That’s not all the good news. As long as you’re under the $500,000 or $250,000 limits, you’re now relieved of having to keep records for years. Under prior law, you needed to keep track of all the money you paid for down payments and capital improvements, as you moved from one house to another, rolling over the unpaid tax.

Unfortunately, the repeal of this rollover provision can cost you money if you’ve been on the housing ladder for years because there was no grandfathering of the old shelter. Suppose, for example, you bought your first house for $50,000 back in the 1960s. Over the years you’ve sold houses and bought increasingly expensive ones, adding enough of your money to increase your “basis” to $100,000.

Say you sell your house for $700,000, giving you a $600,000 gain. Prior law permitted you to defer that gain by rolling the profits into another home of equal or greater value. Under current law, you’ll have a taxable gain no matter what.

If you’re married, you’ll have a $500,000 exemption and a $100,000 taxable gain. If you’re not married–you might be widowed or divorced–your exemption would be only $250,000, leaving you a $350,000 taxable gain.

Therefore, if you think you might have a large gain on a home sale, you still need to keep records of capital improvements, boosting your basis in order to trim your taxes. If you spent $75,000 on home improvements over the years, and have the records to prove it, you can reduce your taxable gain by $75,000.