Guides / Tax Strategies for Individuals
Selling Your Home: How to Minimize the Tax on the Gain
Most home sellers owe nothing on the gain, but the ownership, use, and basis rules behind that exclusion are worth understanding before you sign anything.
In this guide
The exclusion, and who qualifies
The IRS allows you to exclude up to $250,000 of gain on the sale of your main home, or $500,000 if you're married filing jointly. Most sellers who meet the ownership and use tests owe no tax at all on the sale. If you have a loss instead, it's treated as a personal loss and isn't deductible. If your gain exceeds the exclusion, or part of the home was used for business or rental, you'll have a taxable gain to report on Form 8949 and Schedule D.
What counts as your principal residence
Your main home is generally the one you live in most of the time, and it doesn't have to be a traditional house. Houseboats, mobile homes, cooperative apartments, and condominiums all qualify. If you own two homes and split time between them, whichever one you actually live in more counts as your main home for these purposes, regardless of which one has appreciated more.
Figuring your gain or loss
Start with the selling price: everything you receive for the home, including cash, assumed debt, and the value of any property or services received. Subtract selling expenses, commissions, advertising, legal fees, and loan charges you paid, to get the amount realized. Compare that to your adjusted basis; if the amount realized is higher, you have a gain, and if it's lower, a loss.
A few situations complicate this. Jointly owned homes sold on a joint return are figured as one taxpayer, but separate returns require each owner to figure their own gain based on their ownership share. Trading one home for another is treated as a sale and a purchase. A foreclosure or repossession is treated as a disposition, with the amount realized depending on whether you were personally liable for the debt, and can also trigger ordinary income if canceled debt exceeds the home's value. Transfers to a spouse, or a former spouse incident to divorce, generally trigger no gain or loss at all.
Basis: your starting point
Your basis is generally what the home cost you, whether purchased or built, including your down payment, any mortgage debt, and certain settlement or closing costs. If you acquired the home some other way, gift, inheritance, trade, or from a spouse, different rules apply, generally using either the donor's adjusted basis or the home's fair market value at the time you received it.
Over time, your basis is adjusted. Improvements that add value or extend the home's useful life, an addition, a new roof, a finished basement, increase your basis. Ordinary repairs that simply maintain the home's condition don't. Certain items decrease basis instead, including depreciation claimed for business or rental use, insurance payments for casualty losses, and some tax credits claimed for the home. Keeping records of your purchase price, purchase expenses, and every improvement is worth doing as you go, since reconstructing them years later at tax time is far harder.
The ownership and use tests in practice
To claim the exclusion on a sale, you generally need to have owned the home for at least two years and lived in it as your main home for at least two years, both within the five-year period ending on the sale date. The two years don't need to be continuous, and short absences like vacations still count as periods of use even if you rented the home out during that time. You also can't have excluded gain on another home sale within the two years before this sale.
If you owned and used the home for less than two years, a reduced exclusion may still be available in specific circumstances: a change in your place of employment, a health-related move, or certain unforeseen circumstances like a natural disaster or job loss. The reduced amount is calculated proportionally based on how much of the two-year period you actually met.
Special situations
Married couples filing jointly can exclude up to $500,000 if either spouse individually meets both tests, not necessarily both spouses. A surviving spouse is considered to have owned and used the home for any period the deceased spouse did. If your home was destroyed or condemned, any resulting gain, including from insurance proceeds, still qualifies for the exclusion. Using part of your home for a home office doesn't disqualify the sale from the exclusion, except that you can't exclude the portion of gain equal to depreciation claimed for that business use after May 6, 1997.
If you financed the purchase through a federally subsidized program, tax-exempt bond financing or a mortgage credit certificate, you may owe a separate recapture tax when you sell, even if your gain itself is fully excluded. That recapture tax is calculated independently of the exclusion rules discussed above.
Related guide
If you're also weighing points paid on a purchase or refinance around the same transaction, see our guide on The Deductibility of Points.
Frequently asked questions
Do I have to reinvest the proceeds to avoid tax on the sale?
No. That rule was eliminated decades ago. The current exclusion applies regardless of what you do with the proceeds, as long as you meet the ownership and use tests.
What if I sold my home at a loss?
A loss on the sale of a personal residence is not deductible. It's treated as a nondeductible personal loss regardless of the circumstances.
Can I claim the exclusion if I only lived in the home for one year?
Possibly, at a reduced amount, if the sale was due to a change in employment location, health reasons, or certain unforeseen circumstances. Ordinary preference for a different home doesn't qualify for the reduced exclusion.
Does selling a home I used partly for a home office affect the exclusion?
Only the depreciation you claimed for the business portion after May 6, 1997 is excluded from the exclusion and taxed as gain. The rest of the gain on the home itself is unaffected.
Getting ready to sell your home?
Let's confirm your basis, walk through the exclusion rules, and make sure nothing gets missed at tax time.
Schedule a consultationThis guide is for general informational purposes only and is not tax, legal, financial, or investment advice. It does not cover every situation or exception that may apply to you. Consult a licensed professional before making decisions based on this information.