Selling
Your Home
Most homeowners can sell their main home without tax on up to $250,000 of gain, or $500,000 for a married couple filing jointly. Whether you qualify, and for how much, depends on how long you owned and lived there, any rental or home office use, and when you last used the exclusion.
Last reviewed
The 2-out-of-5-year rule
You can exclude up to $250,000 of gain, or $500,000 on a joint return, if you owned the home and lived in it as your main home for at least 2 years during the 5 years before the sale (IRC 121(a), (b)(1)). The 2 years don’t have to be continuous, and the years you owned it and the years you lived in it don’t have to be the same ones (Treas. Reg. 1.121-1(c)).
- Once every 2 years. You can’t use the full exclusion if you excluded gain on another home sale in the 2 years before this one (IRC 121(b)(3)).
- The $500,000 limit for married couples. On a joint return, either spouse can meet the ownership test, but both have to meet the use test, and neither can have used the exclusion in the past 2 years. If you don’t meet all three, each spouse figures their own limit, up to $250,000 each (IRC 121(b)(2)).
- Your main home only. If you have more than one home, your main home is ordinarily the one you live in most of the time (Treas. Reg. 1.121-1(b)(2)). A vacation home qualifies only if it was your main home for 2 of the 5 years.
- No deduction for a loss. A loss on the sale of your own home can’t be deducted (IRS Pub. 523).
How much of the gain can be tax-free?
| Situation | Maximum exclusion |
|---|---|
| Owned and lived in the home 2 of the last 5 years | $250,000 |
| Married filing jointly, both spouses lived there 2 of the 5 years | $500,000 |
| Surviving spouse, sold within 2 years of the death, not remarried | $500,000 |
| Sold early because of a job move, health, or an unforeseen event | A share of the limit, based on time owned and lived there |
| Gain equal to depreciation claimed, or that could have been claimed, after May 6, 1997 | None; taxed at up to 25% |
Selling before 2 years: the partial exclusion
If you sell before meeting the 2-year tests, or within 2 years of an earlier excluded sale, you can still exclude part of the gain if the main reason for the sale is a change in your place of work, your health, or an unforeseen circumstance. The limit is reduced to the share of 2 years that you owned and lived in the home. For example, a single person who owned and lived in the home for 12 months has a limit of $125,000 (IRC 121(c); Treas. Reg. 1.121-3).
- Work. A move automatically qualifies if your new job is at least 50 miles farther from the home than your old job was, or at least 50 miles from the home if you had no job before (Treas. Reg. 1.121-3(c)(2)).
- Health. A move qualifies if its main reason is to get or provide care or treatment for an illness or injury, including for a close relative. A doctor’s recommendation to move for health reasons is an automatic safe harbor (Treas. Reg. 1.121-3(d)).
- Unforeseen circumstances. These automatically qualify: the home being destroyed or condemned, a disaster that damages it, a death, losing a job and qualifying for unemployment, a change in work that leaves you unable to pay basic living costs, divorce or legal separation, and multiple births from one pregnancy. Other events can qualify based on the facts (Treas. Reg. 1.121-3(e)).
- Whose events count. The event can happen to you, your spouse, a co-owner, or someone who lives in your household (Treas. Reg. 1.121-3(f)).
Rental years and depreciation
- Depreciation isn’t excluded. Gain equal to the depreciation you claimed, or could have claimed, after May 6, 1997, for renting the home or using part of it for business, is taxable at up to 25% (IRC 121(d)(6), 1(h)(1)(E); IRS Pub. 523).
- Renting before you move in. Gain from depreciation is taken out first. Of the rest, time after 2008 when the home wasn’t your main home, such as years you rented it out before moving in, makes a share of the gain taxable, in proportion to that time compared with the whole time you owned the home. The exclusion limit applies to the gain that’s left (IRC 121(b)(5); IRS Pub. 523).
- Renting during a short absence. A vacation or other short absence counts as time you lived in the home, even if you rented it out while you were away (Treas. Reg. 1.121-1(c)(2); IRS Pub. 523).
- Renting after you move out. Time after you last lived there, within the 5 years before the sale, doesn’t reduce the exclusion. To still meet the 2-year use test, that generally means selling within 3 years after you move out (IRC 121(b)(5)(C)(ii)(I)).
- Other time that doesn’t count against you. Up to 10 years of qualified extended duty in the military, the Foreign Service, or the intelligence community, and up to 2 years of temporary absence for work, health, or unforeseen circumstances (IRC 121(b)(5)(C)(ii)). People on that kind of duty can also elect to suspend the 5-year period for up to 10 years (IRC 121(d)(9)).
- A home office or rented space. If the office or rented space is part of the same dwelling unit you live in, such as a home office or a rented bedroom, you don’t split the gain, but depreciation on that space is still taxable. A separate dwelling unit, such as a detached building or an apartment with its own kitchen and bathroom, is treated separately, and its gain generally can’t be excluded unless you lived in it for 2 of the 5 years (Treas. Reg. 1.121-1(e); IRS Pub. 523). See renting out your home.
- A home from a like-kind exchange. If you received the home in a section 1031 exchange, the exclusion doesn’t apply until you’ve owned it for 5 years (IRC 121(d)(10)).
Marriage, divorce, death, and care
- Surviving spouse. The $500,000 limit still applies to a sale within 2 years after your spouse’s death if you haven’t remarried and the two of you met the joint requirements just before the death. Your spouse’s years of ownership and use count as yours (IRC 121(b)(4), (d)(2)). See widowed parent returns.
- Divorce. A transfer of the home to you from a spouse or former spouse in a divorce isn’t taxable, and their years of ownership count as yours. If your former spouse lives in the home under a divorce or separation agreement, you’re treated as living there too (IRC 121(d)(3); IRS Pub. 523).
- Moving into care. If you become unable to care for yourself and lived in the home for at least 1 of the last 5 years, time you spend in a licensed care facility, such as a nursing home, counts as living in the home (IRC 121(d)(7)). See caring for an aging parent.
- An inherited home. A home you inherit usually takes a basis equal to its value at the date of death, so there may be little gain. See selling an inherited house.
Figuring and reporting the gain
- Your gain. The sale price, less selling costs such as commissions, minus your adjusted basis: what you paid for the home plus improvements, less depreciation and certain other items such as casualty losses you deducted (IRS Pub. 523). Keep records of improvements for as long as you own the home.
- Tax on the rest. Gain over the exclusion is a long-term capital gain if you owned the home more than a year, taxed at 0%, 15%, or 20%. Taxable gain can also be subject to the 3.8% net investment income tax if your income is over $200,000, or $250,000 on a joint return; excluded gain isn’t (IRC 1411(b), (c)(1)(A)(iii)).
- When the sale goes on your return. Report it on Form 8949 and Schedule D if any of the gain is taxable or if you received a Form 1099-S, even when all of the gain is excluded. Otherwise, a fully excluded sale doesn’t need to be reported. Gain from depreciation, and the sale of a separate business or rental part, are reported on Form 4797 (IRS Pub. 523).
- Choosing not to exclude. You can elect not to use the exclusion, for example if you expect to sell another home with a larger gain within 2 years. You can reverse that choice on an amended return within 3 years after the original due date of the return (IRC 121(f); IRS Pub. 523).
- State tax. State rules can differ from the federal exclusion.
What we handle
- Checking the ownership and use tests, including partial exclusions
- Rebuilding your basis from purchase records and improvements
- Rental and home office years, depreciation, and nonqualified use
- The $500,000 limit for married couples and surviving spouses
- Sales after a move into assisted living or a nursing home
- Reporting the sale, and any Form 1099-S
Frequently Asked Questions
Do I have to report the sale of my home if all the gain is excluded?
Only if you received a Form 1099-S. If you did, the sale goes on Form 8949 and Schedule D even though no tax is due. If you didn’t get one and all of the gain is excluded, you don’t need to report the sale.
I moved out and rented my house. Can I still exclude the gain?
Often, yes, if you lived there as your main home for at least 2 of the 5 years before the sale, which generally means selling within 3 years after you moved out. Rental time after you moved out doesn’t reduce the exclusion, but gain equal to the depreciation you claimed, or could have claimed, while it was rented is taxable.
I have to sell after only a year because of a new job. Is the gain taxable?
Part or all of it may be excluded. If your new job is at least 50 miles farther from the home than your old one, you qualify for a partial exclusion based on how long you owned and lived there. After 12 months, a single person’s limit is $125,000, half of the $250,000.