Selling the house after divorce: taxes and timing
The house is often the last shared thing, and the tax rules around selling it are easier to get wrong than they look. This is a plain-language walk through the IRS home-sale exclusion after a divorce, including the special rule when one of you stays and the other has already moved out. It is general information, not tax or legal advice.

The house is rarely just an asset. It is the hallway you both still picture, the school run, the last shared password. And then it is also a tax problem with a deadline you can miss.
This is a walk through the federal tax rules that come up most often when a married home is sold or transferred in a divorce. It is general information, not tax, legal, or financial advice. The numbers in your case, and the terms in your judgment, belong with a tax professional and, when needed, a family-law attorney.
Selling to a third party is a different event from transferring the house to your ex
If you transfer the house, or your share of it, to a spouse or ex-spouse as part of the divorce, the IRS generally treats that as a transfer with no gain or loss.1 That rule lives in section 1041 of the tax code, which says that no gain or loss is recognized on a transfer to a spouse, or to a former spouse if the transfer is incident to divorce.4
You still have to get the title, the mortgage, and the settlement agreement right. Those are not small jobs, and they are not the same as a taxable sale. Publication 504 is the IRS’s broader guide for divorced or separated taxpayers and is worth reading alongside the home-sale rules.3
If the house is instead sold to a third party, that is a sale, and the home-sale exclusion in Publication 523 and section 121 may apply to some or all of the gain.12
The exclusion is $250,000, or $500,000 only in a narrower situation
If the sale qualifies, you may be able to exclude up to $250,000 of gain, or up to $500,000 if you are married filing jointly and both meet the tests.1 After a divorce is final, you generally are no longer filing jointly as a married couple, so the $500,000 figure should not be assumed. Each person may still qualify for up to $250,000 if they meet the eligibility tests on their own, but that is a “may,” and it depends on ownership, use, and the facts of the sale.1
Publication 523 also describes a partial exclusion in some situations, and a short list of automatic disqualifications, including certain like-kind exchanges and expatriate-tax rules.1 If any of that might apply, stop here and take the publication to a tax professional.
The special use rule when one of you has already moved out
To take the maximum exclusion, you generally have to meet an ownership test and a use test: you owned the home, and you used it as your main home, for the required period.1 Divorce makes the use test easy to fail if you moved out a year or two before the sale.
The statute has a specific answer to that. Under section 121(d)(3)(B), for purposes of the use test, you are treated as using the property as your principal residence during any period of ownership in which your spouse or former spouse is granted use of the property under a divorce or separation instrument.2 In plain terms: if the judgment or separation agreement gives your ex the right to stay in the house, that period can still count toward your use test even though you are living somewhere else.
That provision is precise. It depends on a qualifying divorce or separation instrument, and on the other person being granted use of the home. It is not a vague fairness principle, and it does not replace the rest of the eligibility tests.2
Publication 523 also walks through how to determine the date of sale and which property counts as your main home if you have more than one.1
What to do with this before you list the house
- Read Publication 523 and, if you are divorced or separating, Publication 504, before you sign a listing agreement.13 They are readable, and they are the actual rules.
- Do not assume the $500,000 exclusion still applies once the divorce is final. Check how you will file, and who still meets the tests.1
- If one of you will stay in the house until it sells, get that use right into the agreement. That is what makes section 121(d)(3)(B) available.2
- A transfer to your ex and a sale to a buyer are different transactions, with different tax results.14
- Have a tax professional run your basis, your dates, and your expected gain. The exclusion is about gain, not about the sale price.
If the house has been the last shared piece of a long marriage, we have a related piece on divorce after a long marriage.
Try it
Is this something the IRS publications actually cover, or a question for your own advisor?
People who talk about this
- Credentialed source
Eli J. Finkel
Research on how modern marriage and long term relationships work, and what partners expect from each other.
- Credentialed source
- Trending voice
Julie Menanno
How couples get stuck in conflict cycles and how to feel secure with a partner.
- Credentialed source
Lori Gottlieb
What happens in the therapy room, including breakups, dating choices and the stories people tell about love.
- Credentialed source
Pepper Schwartz
Research and writing on love, sex and relationships, including dating and partnership later in life.
Further reading
American Psychological Association
Healthy divorce: How to make your split as smooth as possible (opens apa.org)Psychologists explain the anger, grief and fear divorce stirs up and how to manage them without lasting damage.