Selling the marital home: capital gains, basis and timing
Two sections of the tax code decide most of the money in this decision, and neither of them will be explained to you by an estate agent. Section 121 is the exclusion that can save you six figures. Section 1041 is the rule that quietly hands the tax bill to whoever keeps the house. Read this before you agree to a split, not after.
The capital gains question: Section 121
The home sale exclusion under I.R.C. s. 121 is the single biggest number most people never think to check during a divorce. It can shelter up to 500,000 dollars of gain for a married couple, or as little as 250,000 for a single filer, and the difference often turns on when the sale happens relative to the divorce, not just on how much the house is worth.
A single filer can exclude up to 250,000 dollars of gain on the sale of a principal residence; a married couple filing a joint return can exclude up to 500,000 dollars.
IRS Publication 523 states the basic exclusion is 250,000 dollars for single filers, increased to 500,000 dollars for a married couple filing jointly. I.R.C. s. 121(b) sets the same figures in the statute itself.
$250,000 for single filers, increased to $500,000 for a married couple filing jointly
I.R.C. s. 121(b)(1)-(2); IRS Publication 523 (2025)
To claim the exclusion you generally must meet both an ownership test and a use test: you must have owned and used the home as your principal residence for at least 2 of the 5 years before the sale.
I.R.C. s. 121(a) requires ownership and use ‘for periods aggregating 2 years or more’ during the 5-year period ending on the date of sale. Publication 523 restates this as the ownership requirement (owning the home for at least 24 months during the prior 5 years) and the residence requirement (using it as a main home for at least 24 months in that same window). For a married couple filing jointly, only one spouse needs to satisfy the ownership test, but each spouse must separately satisfy the use test to get the full 500,000 exclusion.
owned and used by the taxpayer as the taxpayer’s principal residence for periods aggregating 2 years or more
I.R.C. s. 121(a); IRS Publication 523
A spouse who moved out of the marital home can still satisfy the use test if the ex-spouse continues living there under a divorce or separation instrument.
This is the provision most divorcing spouses never hear about. I.R.C. s. 121(d)(3)(B) provides that an individual is treated as using the property as a principal residence during any period the individual’s spouse or former spouse is granted use of the property under a divorce or separation instrument. In plain terms: if you move out and your ex stays in the house under the terms of your settlement, the clock does not stop running against you. You can still meet the 2-of-5-years use test years after you left, as long as your ex was living there under a qualifying instrument.
shall be treated as using property as such individual’s principal residence during any period of ownership while such individual’s spouse or former spouse is granted use of the property under a divorce or separation instrument
A ‘divorce or separation instrument’ for this purpose includes a decree of divorce or separate maintenance, a written instrument incident to such a decree, a written separation agreement, or a decree requiring support payments.
This definition, borrowed from the same statute, matters because informal arrangements without a written decree or agreement generally will not qualify a spouse for the s. 121(d)(3) use-attribution rule.
a decree of divorce or separate maintenance or a written instrument incident to such a decree, a written separation agreement, or a decree requiring a spouse to make payments for the support or maintenance of the other spouse
If property is transferred between spouses or former spouses incident to divorce in a way that qualifies under s. 1041, the recipient’s ownership period includes the time the transferring spouse owned the property.
This tacking rule under s. 121(d)(3)(A) means a spouse who receives full ownership of the house in the divorce settlement does not have to restart the 2-year ownership clock; the years the couple owned it together still count.
the period such individual owns such property shall include the period the transferor owned the property
Selling the home while still married and filing a joint return can preserve the full 500,000 dollar exclusion in a way that selling the same house a year later, as two single filers, may not.
Because the 500,000 dollar exclusion under s. 121(b)(2) requires filing a joint return and having each spouse separately meet the use test, timing the sale to close before the divorce is final, with a joint return still available for that tax year, can double the sheltered gain compared to two individual 250,000 dollar exclusions claimed later. Whether each ex-spouse can independently claim 250,000 after the split depends on each one separately meeting the ownership and use tests for their own share, which the s. 121(d)(3) use-attribution rule can help with if one moved out.
$500,000 for a married couple filing jointly
I.R.C. s. 121(b)(2); s. 121(d)(3)
A partial exclusion is available when the ownership or use test is not met, or the once-every-two-years limit is not satisfied, because of a change in place of employment, health, or other ‘unforeseen circumstances.’
Publication 523 lists divorce among the events that can trigger eligibility for a reduced, prorated exclusion rather than none at all. The regulation under Treas. Reg. s. 1.121-3 supplies a specific safe harbor list of events that automatically qualify as unforeseen circumstances, and it plainly includes divorce.
Divorce or legal separation under a decree of divorce or separate maintenance
I.R.C. s. 121(c); Treas. Reg. s. 1.121-3(e)
Treas. Reg. s. 1.121-3(e)(2) lists specific safe-harbor events that are deemed unforeseen circumstances, and divorce or legal separation under a decree is on that list; the regulation also shows, through its own examples, that events outside the enumerated list can sometimes qualify too if the facts and circumstances support it.
This matters for the page: it is fair to say plainly that the regulation names divorce or legal separation under a decree as a safe-harbor unforeseen circumstance for the partial exclusion. It is not fair to say informal separation without a decree automatically qualifies, nor that every divorce-adjacent life event is on the safe-harbor list. The safe harbor is for the specific circumstance of a decree of divorce or separate maintenance.
Divorce or legal separation under a decree of divorce or separate maintenance
The 500,000 figure requires filing a joint tax return for the year of sale and each spouse separately meeting the 2-year use test. Sell after the divorce is final as two single filers, and each person is generally capped at 250,000 dollars of their own gain, unless the s. 121(d)(3) use-attribution rule extends one spouse’s use period.
Under s. 121(d)(3)(B), if your ex-spouse continued living in the house under a divorce or separation instrument after you left, that occupancy counts as your use too. Many people give up a real exclusion because they assume moving out disqualifies them.
What to actually do
- Ask early whether a sale can close before the divorce is final, while a joint return is still available, if the gain is large enough that the 500,000 versus 250,000 gap matters.
- If one spouse moves out and the other stays in the house under the settlement, keep a copy of the decree, separation agreement, or support order. That paperwork is what makes the s. 121(d)(3) use-attribution rule work later.
- If the sale happens after a long absence and the ownership or use test is close, ask a tax professional whether the s. 121(d)(3) tacking and use-attribution rules cover the gap, or whether the partial ‘unforeseen circumstances’ exclusion under Treas. Reg. s. 1.121-3(e)(2) applies because of the divorce decree itself.
- This is general information about I.R.C. s. 121, not tax advice for a specific return. State income tax treatment of the gain may differ from the federal exclusion.
- The examples above use round, illustrative numbers and simplified assumptions about an even split of gain and ownership; actual allocation of gain between spouses depends on how title and the settlement allocate the proceeds and each spouse’s basis.
A couple bought their home years ago for 300,000 dollars and it is now worth 900,000 dollars, for a gain of 600,000 dollars. Both spouses have lived there the whole time. They are in the middle of a divorce.
- If they sell the home and close before the divorce is final, filing a joint return for that year: they can exclude 500,000 dollars of the 600,000 gain, leaving 100,000 dollars taxable.
- If instead the divorce finalizes first, one spouse moves out, and the house sells a year later with each now filing single: each spouse reports their share of the 600,000 gain (300,000 dollars each, assuming an even split). Each can exclude up to 250,000 dollars of their own share, assuming each separately meets the ownership and use tests. That leaves 50,000 dollars taxable per person, 100,000 dollars total, which happens to match the joint-filing outcome in this example only because the gain split evenly under the 250,000 cap per person.
- The exposure grows quickly if the gain is lopsided or larger: on a 700,000 dollar gain split evenly, joint filing before the divorce shelters 500,000 and leaves 200,000 taxable, while two single filers after the divorce shelter 250,000 each (500,000 total) and leave the same 200,000 taxable, so the two paths can converge or diverge depending on the exact numbers and whether both spouses can each independently satisfy the use test.
The exclusion math is not automatic. Whether selling married-filing-jointly beats selling later as two single filers depends on the size of the gain, how it is split, and whether each spouse can independently satisfy the ownership and use tests, including through the s. 121(d)(3) use-attribution rule. This is worth running the actual numbers on before deciding when to list the house.
I.R.C. s. 1041: the house is not worth what it looks like on paper
Transfers of property between spouses, or between former spouses incident to divorce, are generally not taxable events. But the tax bill does not disappear, it moves with the property. The spouse who keeps the house also keeps its embedded, unpaid capital gains tax liability, which means a house and a retirement account of the same appraised value are almost never actually equal.
No gain or loss is recognized on a transfer of property from an individual to a spouse, or to a former spouse if the transfer is incident to the divorce.
This is the general rule of I.R.C. s. 1041(a). It applies whether the transfer happens during the marriage or as part of the divorce settlement.
No gain or loss shall be recognized on a transfer of property from an individual to (or in trust for the benefit of) a spouse, or a former spouse, but only if the transfer is incident to the divorce
The spouse who receives the property in the transfer takes the transferring spouse’s original tax basis, not the property’s current market value.
Under s. 1041(b), the transfer is treated as if it were a gift for basis purposes: the transferee’s basis equals the transferor’s adjusted basis immediately before the transfer. This is the mechanism by which the tax liability moves with the asset instead of being settled at the time of the divorce.
the property shall be treated as acquired by the transferee by gift, and its basis in the hands of the transferee shall be its basis in the hands of the transferor
A transfer is treated as ‘incident to the divorce,’ and therefore covered by s. 1041, if it occurs within 1 year after the marriage ends, or if it is related to the ending of the marriage.
I.R.C. s. 1041(c) sets out these two alternative tests. The implementing regulation, issued as a temporary regulation and still applied, translates the ‘related to’ test into a presumption: a transfer pursuant to a divorce or separation instrument that occurs within 6 years of the date the marriage ends is presumed related to the divorce; a transfer outside either the 1-year or 6-year window is presumed unrelated, though that presumption can be rebutted with evidence the transfer was made to complete the division of property owned at the time the marriage ended, for example where a legal impediment delayed it.
occurs not more than one year after the date on which the marriage ceases
I.R.C. s. 1041(c); Treas. Reg. s. 1.1041-1T, Q&A-6 and Q&A-7
The 6-year presumption can be overcome by showing the transfer was made to complete the division of property that the former spouses owned at the time the marriage ended, such as when legal or business impediments delayed an earlier division.
This is the rebuttal standard the regulation sets for transfers made pursuant to a divorce or separation instrument that fall outside the 1-year automatic window but within 6 years.
was made to effect the division of property owned by the former spouses at the time of the cessation of the marriage
Treas. Reg. s. 1.1041-1T, Q&A-7
Publication 504 confirms the same nonrecognition and carryover-basis treatment for property transferred incident to divorce, in plain-language IRS guidance rather than statutory text.
Reported consistently, not settled
Publication 504 describes the transfer as receiving gift-like tax treatment, with the recipient spouse taking a carried-over basis from the transferring spouse, consistent with the statute and regulation.
IRS Publication 504, ‘Property Settlements’
They are not, once taxes are accounted for. Because of s. 1041’s carryover basis rule, the spouse who keeps the house inherits whatever capital gain has already built up in it, taxable whenever the house is eventually sold (subject to the s. 121 exclusion). A traditional retirement account carries its own, usually larger, embedded tax liability at ordinary income rates on withdrawal. Comparing the two dollar-for-dollar without adjusting for embedded tax is one of the most common and costly mistakes in a divorce settlement.
What to actually do
- Before agreeing to ‘take the house’ in exchange for other assets, find the home’s actual adjusted basis (see the basis section) and estimate the built-in gain, not just its current market value.
- Ask whether the s. 121 exclusion, 250,000 dollars for a single filer, would cover most or all of that built-in gain if the house is sold later, or whether a real tax bill is being handed to one spouse along with the keys.
- If a transfer will happen more than a year after the divorce is final, document that it is pursuant to the divorce or separation instrument and, if it falls outside the 1-year window, keep records showing it completes the agreed division of property from the time the marriage ended, in case the 6-year presumption is ever challenged.
- When comparing a house to a retirement account in a settlement, remember the two carry very different tax character: capital gains on a home sale (partly shelterable under s. 121) versus ordinary income tax on most retirement withdrawals. A financial professional can model the after-tax value of each side of a proposed split.
- This explains general federal income tax treatment under s. 1041, not state property division law, which determines who gets what asset in the first place. State community property or equitable distribution rules are separate from this federal tax question.
- The worked example uses simplified, round numbers and ignores selling costs, state tax, and the net investment income tax that can apply to some capital gains; a real settlement should use the parties’ actual basis and consult a tax professional.
A couple is dividing two assets of equal appraised value: the marital home, worth 900,000 dollars with an adjusted basis of 500,000 dollars (400,000 dollars of embedded gain), and a taxable brokerage account also worth 400,000 dollars, with a basis of 400,000 dollars (no embedded gain, for simplicity). One spouse proposes: ‘I’ll take the house, you take the brokerage account, that’s fair, they’re both worth about the same.’
- The spouse who takes the house takes it with the transferor’s original basis of 500,000 dollars under s. 1041(b). No tax is due at the time of the transfer.
- If that spouse later sells the house for 900,000 dollars, the gain is 400,000 dollars. As a single filer who meets the ownership and use tests, up to 250,000 dollars of that gain can be excluded under s. 121, leaving 150,000 dollars taxable at long-term capital gains rates.
- The spouse who takes the brokerage account, in this simplified example with no embedded gain, owes no capital gains tax on that 400,000 dollars if it is simply held or spent.
- So the ‘equal’ split leaves one spouse with a real, after-tax value below 400,000 dollars (400,000 minus tax on 150,000 dollars of gain) and the other spouse with the full 400,000 dollars available. The house was never really worth 400,000 dollars net of tax; it was worth 400,000 dollars minus a deferred tax bill.
Under s. 1041, tax is not eliminated at divorce, it is deferred and it travels with the asset. Any settlement that treats a house and a cash or investment account as interchangeable without adjusting for the house’s embedded gain is quietly favoring whoever keeps the liquid asset.
Basis: why old receipts are worth real money
Basis is the number the capital gains tax is measured against, and it is built from more than the purchase price. Every dollar of documented improvement raises basis and lowers the eventual taxable gain. Because divorce often means one spouse loses access to records after the split, gathering this paperwork now, while both people can still find it, is one of the most concretely valuable things either spouse can do.
Basis starts with what was paid for the home, including certain settlement and closing costs, and is increased by the cost of improvements.
Publication 523 lists specific closing costs that count toward basis, including legal fees, survey fees, and transfer or stamp taxes, along with amounts for debts the buyer assumed. It then separately lists improvements, capital expenditures that add to the value of the home, prolong its useful life, or adapt it to new uses, as additions to basis.
legal fees; survey fees; transfer or stamp taxes
IRS Publication 523, ‘Determine Your Basis’
Improvements add to basis; repairs that simply maintain the home in its existing condition do not.
Publication 523 draws this line explicitly: routine repairs and maintenance, such as painting or fixing a leak, do not increase basis because they do not add value or extend the home’s useful life. An improvement, like a room addition or a new roof, does increase basis because it is a capital expenditure rather than upkeep.
repairs that merely maintain condition (painting, fixing leaks) do not increase basis
IRS Publication 523, basis and improvements discussion
Mortgage points and most loan fees are not part of a home’s basis.
Reported consistently, not settled
These are financing costs, not costs of acquiring or improving the property, so Publication 523 excludes them from basis even though they are real costs paid at closing.
Basis is the purchase price plus certain acquisition costs, plus every dollar spent on qualifying capital improvements over the years the house was owned, minus certain adjustments. A couple who put in a new kitchen, a new roof, and a finished basement over fifteen years may have a basis meaningfully higher than the purchase price, which directly reduces the taxable gain on sale.
What to actually do
- Before the settlement is finalized, both spouses should independently pull together purchase documents, the closing statement from the original purchase, and every receipt or contractor invoice for capital improvements: additions, new systems, remodels, a new roof, a finished basement, landscaping that adds value.
- Sort expenses into two piles: improvements (add to basis) and repairs or routine maintenance (do not). When in doubt, keep the document and let a tax preparer make the call later; it is much harder to reconstruct this after the fact than to keep the paper now.
- If one spouse is moving out and losing physical access to filing cabinets or a shared email account with digitized receipts, make copies or scans of this documentation before the move, not after.
- Basis records matter most for people who might have a large built-in gain, especially in markets where home values have risen sharply since purchase and the gain could approach or exceed the s. 121 exclusion amount.
- This list is illustrative of the categories Publication 523 describes, not a complete checklist; a tax professional should review actual receipts against current IRS guidance for the year of sale.
Help with the house sets out the four things that can happen to it — a buyout, a deferred sale, a sale now, or the court deciding — and when it is too early to call an agent at all.
Disclosure: Hyleri Katzenberg · Compass — licensed real estate salesperson in Connecticut and Florida, working in Fairfield County, Connecticut and Palm Beach County, Florida. If you ask for an introduction to an agent anywhere else, she receives a referral fee from that agent, paid out of their commission and never added to what you pay. Nothing else on The Cusp works this way — nobody pays to be in the directory. How we make money.
We can introduce you to an agent who has done this kind of sale before — someone who knows what an automatic order does to a listing, and how to work a sale where the two owners are not speaking. There is no cost for the conversation and no obligation.
Ask for an introduction to an agent → — who we would introduce you to, what the referral fee is and who pays it, and why the answer is sometimes that you should not sell at all.
Keep reading
- If you want to keep it instead
- Divorce and taxes
- Dividing retirement — the same equal-is-not-equal problem
- Choosing a realtor who has done this before