Let’s get straight to the answer: No. You cannot “defer” capital gains on your main home.
This idea of “deferring” or “rolling over” profit comes from an old, dead tax law, IRC § 1034, which was completely replaced in 1997.1 Today, you don’t delay the tax; you erase it using a powerful rule called the IRC § 121 Exclusion.1
The primary conflict in your divorce is a collision between two separate IRS rules. The problem is that most people, and even some lawyers, use the wrong one.
The conflict is between IRC § 1041 (The Transfer Rule) and IRC § 121 (The Exclusion Rule).11 Using the wrong rule, like applying the “sale” exclusion to a spousal “buyout,” creates a massive, hidden tax bomb years later.13 This single mistake can cost you tens or even hundreds of thousands of dollars.
This is not a small problem. In the United States, an estimated 65-70% of all divorces involve dividing real estate, making this the most significant financial event for millions of couples.14
This guide will give you the clarity you need.
What You’ll Learn
- 🏠 Why asking to “defer” your taxes is an outdated question, and why the word you must know is “exclude.”
- 💔 The Carryover Basis Trap: The single biggest tax mistake you can make in a buyout and how to avoid it.
- ⏰ How timing your sale before the divorce is final can get you a $500,000 tax-free exclusion (and how selling after cuts it in half).
- 🏃♂️ The “magic words” you must add to your divorce decree to save your $250,000 exclusion if you’re the spouse who already moved out.
- 📝 How to handle the three main scenarios: a spousal buyout, a joint sale to a stranger, and co-owning after the divorce.
The Two Pillars of Divorce Tax Law: § 121 vs. § 1041
When you get divorced, the IRS gives you two different toolkits for the house. You cannot mix and match them. You must know which one you are using.
Pillar 1: The “Sale” Rule (IRC § 121 Home Sale Exclusion)
This is the rule you use when you and your spouse sell your house to a third-party buyer on the open market.
It is a permanent tax exclusion. The profit is erased. It is not delayed; it is gone forever.
The law, Internal Revenue Code § 121, allows you to exclude a massive amount of profit from your income 15:
- $250,000 of profit if you are a single filer.
- $500,000 of profit if you are married and file a joint tax return.15
To qualify for this tax break, you must pass two simple tests in the five years before the sale 15:
- The Ownership Test: You must have owned the home for at least two years (24 months).
- The Residency Test: You must have lived in the home as your main residence for at least two years.
There is a critical detail here for married couples. To get the full $500,000 joint exclusion, the law is very specific:
- Only one spouse needs to meet the 2-year Ownership Test.
- BUT… both spouses must meet the 2-year Residency Test.11
This small detail is the exact reason the “Out-Spouse” (the person who moves out) gets into so much trouble. We will solve that later.
Pillar 2: The “Transfer” Rule (IRC § 1041 Tax-Free Transfer)
This is the only rule that applies when you “sell” your share of the house to your spouse or ex-spouse. This is the “buyout” scenario.21
The law, Internal Revenue Code § 1041, states that any transfer of property between spouses during a divorce is not a taxable event.23 The exact legal text says “No gain or loss shall be recognized”.12
This rule applies to any transfer that is “incident to divorce.” This means the transfer happens within one year of the divorce or is “related to the cessation of the marriage,” which covers anything required by your divorce decree, even years later.23
The IRS views a married couple as a single financial unit. A divorce is just dividing that unit. A buyout isn’t a “sale”; it’s a transfer.
Because a § 1041 transfer is not a sale, there is no gain to tax. Therefore, you cannot use the § 121 exclusion. You don’t need to. The transfer is already tax-free.25
This seems wonderful, but this rule creates the single most dangerous financial trap in all of divorce law for the person who keeps the house.
| Transaction Type | Pillar 1: IRC § 121 (The Exclusion) | Pillar 2: IRC § 1041 (The Transfer) |
| What Is It? | A tax-free sale of your main home. | A tax-free transfer of property between spouses. |
| When Is It Used? | When you sell the home to a third-party buyer. | When one spouse “buys out” the other spouse. |
| The Tax Consequence | Profit is permanently erased (up to $250k/$500k). | No tax is due. It’s a non-taxable event. |
| The Hidden Landmine | The “Out-Spouse” fails the Residency Test. | The “In-Spouse” falls into the “Carryover Basis Trap.” |
The Buyout: Why “Keeping the House” Hides a Massive Tax Trap
This is the most common and devastating financial mistake in a divorce.26
It happens when one spouse (the “In-Spouse”) wants to keep the home. The other spouse (the “Out-Spouse”) moves out. The In-Spouse gives the Out-Spouse cash or other assets (like a retirement account) for their share of the home’s equity.21
At the time of the divorce, this is 100% tax-free for both people under § 1041.12 The Out-Spouse who gets the cash pays no tax. The In-Spouse who gets the house pays no tax.
It feels simple. But the In-Spouse has just walked into a financial trap.
The $700,000 Surprise: How “Carryover Basis” Creates a Financial Landmine
This trap is called the “Carryover Basis” rule.3
To understand it, you must first know what your “tax basis” is. Your “basis” is the number you subtract from your sale price to find your legal “profit.”
Your Adjusted Basis is NOT your mortgage balance.30
- It is your Original Purchase Price… 25
- PLUS the cost of Major Capital Improvements (like a new roof, kitchen remodel, or addition).25
- It does not include simple repairs (like painting a room).
The “Carryover Basis” rule says that in a § 1041 transfer, the In-Spouse who keeps the house also keeps the couple’s original, low basis.23 The basis “carries over.”
The In-Spouse does not get a new, higher basis for the money they paid in the buyout.
Let’s see the trap in action:
- The Past: A couple bought a home 20 years ago for $200,000. They did $100,000 in improvements. Their Adjusted Basis is $300,000.
- The Divorce: The house is now worth $1,000,000. The built-in profit (gain) is $700,000.
- The Buyout: The In-Spouse gives the Out-Spouse $500,000 in cash for their half. The Out-Spouse walks away 100% tax-free. The In-Spouse now owns a $1,000,000 house.
- The Future Nightmare: Five years later, the In-Spouse (now single) sells the house for $1,100,000.
- In-Spouse’s Sale Price: $1,100,000
- In-Spouse’s Basis: $300,000 (the original carryover basis)
- Total Profit: $800,000
- In-Spouse’s “Single” Filer Exclusion: $250,000
- Taxable Gain: $550,000
The In-Spouse now owes capital gains tax on $550,000. This is a tax bill that could easily be over $130,000.
This is not an “equitable” 50/50 split. One spouse got $500,000 in tax-free cash. The other spouse got a $1,000,000 asset that looks valuable but has a $550,000 hidden tax bomb attached to it.26
A smart divorce settlement must account for this. The spouse taking the house should get other assets (like more cash or retirement funds) to “equalize” and compensate them for this future tax bill.27
| The Buyout: Action | The Hidden Consequence (Carryover Basis Trap) |
| Spouse A (“Out-Spouse”) transfers their half of the house to Spouse B. | Tax-Free. Receives $500,000 in cash. Reports $0 gain.12 |
| Spouse B (“In-Spouse”) pays $500,000 cash for Spouse A’s half. | Hidden Tax Bomb. Receives a $1,000,000 house but is stuck with the original $300,000 basis.28 They have a $700,000 “built-in” gain and only a $250,000 single exclusion to protect them when they sell.35 |
The Joint Sale: How Timing Your Divorce Date Can Save You $250,000
This is the “clean break” option.38 You and your spouse sell the house on the open market and a title company divides the cash.39
This is a sale, so the § 121 Exclusion rule applies.
The only question is: do you get the giant $500,000 exclusion or two small $250,000 exclusions? The answer depends entirely on when you sell.
Strategy 1: Selling Before the Divorce is Final
This is the best financial strategy if your home has more than $250,000 in profit.
The IRS only cares about your marital status on December 31st of the tax year.30 If you sell the house in June and your divorce is not final by December 31, the IRS still sees you as “Married” for that entire tax year.
This allows you to file one last “Married Filing Jointly” tax return.
By filing jointly, you can claim the full $500,000 exclusion.44 If your total profit is $450,000, you pay zero tax.
This strategy requires cooperation. You must agree on the listing agent, the price, and the repairs, all while going through a divorce.47 The emotional stress can be high.47
Strategy 2: Selling After the Divorce is Final
This is often the emotionally “cleaner” choice, but it can be a tax disaster.
If your divorce is finalized on December 30th, you are “Single” taxpayers for that entire year.30 The $500,000 joint exclusion is gone forever.45
Now, you each must individually qualify for your own $250,000 exclusion.27
This is fine if your total profit is under $500,000. A $400,000 profit is split ($200,000 for you, $200,000 for your ex). Each person’s $250,000 exclusion easily covers their share.
But this strategy creates the dreaded “Out-Spouse Problem.”
| Timing of Sale | The Tax Rule & Consequence |
| Sell Before Divorce is Final | Rule: You are “Married” for the full tax year (as of Dec. 31).30 Consequence: You file a joint return and get the $500,000 exclusion. This is the best way to shield a large profit.45 |
| Sell After Divorce is Final | Rule: You are “Single” taxpayers.45 Consequence: You each must qualify for your own $250,000 exclusion. This is fine, unless one of you fails the 2-in-5-year test.45 |
The “Out-Spouse” Problem: How to Save Your Exclusion After You’ve Moved Out
This scenario is the direct result of selling after the divorce or co-owning the home for a period.
Here is the problem:
- A couple, Pat and Sam, gets divorced.
- The divorce decree lets Sam (the “In-Spouse”) live in the co-owned house with the children for 4 years.25
- Pat (the “Out-Spouse”) moves into an apartment.
- After 4 years, they sell the house for a $400,000 profit. Pat gets $200,000 and Sam gets $200,000.
Here is the failure:
- Sam (In-Spouse): Easily passes the 2-in-5-year residency test. Sam lived there for all 5 years. Sam’s $200,000 profit is 100% excluded. Sam pays $0 tax.
- Pat (Out-Spouse): Fails the 2-in-5-year Residency Test.26 Pat has not lived in that house for 4 of the last 5 years.
- The Consequence: Pat loses their entire $250,000 exclusion. Pat’s $200,000 share of the profit is now fully taxable. Pat gets a surprise tax bill for $40,000 or more.
This is a totally avoidable disaster.
The “Magic Words”: Your Only Defense Against the Residency Test
The tax code provides a specific, powerful solution for this exact problem.
The law is IRC § 121(d)(3)(B).27
This law states that an Out-Spouse “shall be treated as using property as such individual’s principal residence” during any period where their former spouse is granted use of the home under a divorce or separation instrument.27
In simple English, this rule lets the Out-Spouse (Pat) “count” all the time the In-Spouse (Sam) lived in the house as their own. This allows Pat to easily pass the 2-in-5-year residency test and save their $250,000 exclusion.25
This is the most critical part: This protection is NOT automatic.
It only works if your divorce decree or separation agreement contains a provision that specifically grants your ex-spouse the right to live in the home.25
If your lawyer fails to include these “magic words” in the decree, you lose the tax break. Period.17 A lazy lawyer can cost you tens of thousands of dollars.60
| The “Out-Spouse” Sale: Decree Language | The Tax Consequence |
| Decree is MISSING the magic words. | Failure. Out-Spouse fails the 2-in-5-Year Residency Test. Their $200,000 profit is fully taxable.17 |
| Decree INCLUDES language granting the In-Spouse use of the home. | Success. Out-Spouse “counts” the In-Spouse’s residency.9 They pass the test. Their $200,000 profit is 100% excluded. They pay $0 tax.27 |
Why State Law Matters: Community Property vs. Common Law
Federal law (the IRS) tells you how your profit is taxed. But your state law tells you who owns that profit in the first place.61
There are two systems in the U.S. 61:
1. Community Property States
These states include California, Texas, Arizona, Washington, and a few others.54
- The Rule: All property and income acquired during the marriage is generally considered 100% “community property”.62 This means you both own it 50/50, even if the deed and mortgage are only in one spouse’s name.54
- The Consequence: The 50/50 split of the profit is usually automatic.
2. Common Law (Equitable Distribution) States
This is most of the country, including New York, Florida, Illinois, and Ohio.54
- The Rule: Property generally belongs to the spouse whose name is on the title.62 In a divorce, a judge divides assets “equitably” (fairly), which does not always mean an equal 50/50 split.54
- The Consequence: This can create an “Ownership Test” problem. What if the house is only in your spouse’s name, but you get it in the divorce? You would fail the 2-in-5-year Ownership Test.
- The Fix: The tax code has another special rule for this. IRC § 121(d)(3)(A) lets a spouse who receives a house in a buyout “tack on” their ex-spouse’s ownership period to their own.9
High-Net-Worth and Other Dangerous Edge Cases
The rules get more complex when more money is involved.
High-Net-Worth Divorces
In high-net-worth divorces, the financial complexities grow exponentially.13 The $250,000 or $500,000 exclusion is often not enough to cover the profit on a luxury home.26
The “Carryover Basis Trap” becomes catastrophic.26 A $5 million home with a $1 million basis carries a $4 million built-in gain. The spouse who takes that asset is taking on a massive future tax bill.
In these cases, the only thing that matters is the “after-tax value” of every asset.3 A $1 million cash account is not equal to a $1 million house with a $300,000 basis.26
The Non-Resident Alien Spouse Exception
This is the most critical exception.
The tax-free transfer rule, § 1041, does NOT apply to any transfer of property to a spouse or ex-spouse who is a “nonresident alien”.24
This means a buyout is not a tax-free transfer. It is a fully taxable sale.11 The spouse transferring the property will recognize the capital gain immediately.
Your Financial Team: The Key Players Who Will Protect You (and Who Won’t)
You cannot navigate this alone. Divorce is an emotional process, but dividing assets is a complex financial transaction.54
- Family Law Attorney: This is your primary advocate. Their job is to fight for your legal rights under your state’s laws.47 A good one will know to bring in a tax expert.77 A great one might also be a CPA.78
- Certified Public Accountant (CPA): This person is essential. Your lawyer handles the divorce; the CPA handles the tax consequences.27 They are the ones who will calculate the “after-tax value” and protect you from the Carryover Basis Trap.27
- Certified Divorce Financial Analyst (CDFA): This is a financial planner who specializes in divorce.72 They help you build a new, realistic post-divorce budget and analyze settlement proposals.36
- Real Estate Appraiser: Do not guess what the house is worth. You need a formal, professional appraisal to set the Fair Market Value for a buyout or the court.75
- The Big Conflict of Interest: DO NOT use your joint financial advisor.86 That person has an inherent conflict of interest.87 They cannot ethically advise both of you when your financial interests are now opposed.86 You must hire your own independent team.84
Mistakes, Strategies, and Key Decisions
This is a time of high emotion, which leads to bad financial decisions.54
Top 6 Mistakes to Avoid
- Falling for the “Carryover Basis Trap.” This is the #1 error.26 Do not accept a house in a buyout without calculating the after-tax value. Demand other assets (cash, retirement funds) to compensate you for the hidden tax bill you are inheriting.13
- Forgetting the “Magic Words.” If you are the Out-Spouse, your entire $250,000 exclusion depends on having the IRC § 121(d)(3)(B) language in your final decree.27
- Mistiming the Divorce. Finalizing your divorce on December 30th is a terrible mistake.30 Waiting just two more days (until January) could let you file jointly for the prior year’s sale and get the full $500,000 exclusion.30
- Confusing “Basis” with “Mortgage.” People in forums constantly get this wrong.31 Your mortgage balance has zero to do with your taxable profit.30 Profit is Sale Price minus your Adjusted Basis (original purchase price + improvements).25
- Thinking a “1031 Exchange” Applies. You will hear this term. A 1031 Exchange is only for investment and business properties.44 You cannot use it for your primary residence.44
- Not Getting Your Name Off the Mortgage. A divorce decree does not override your loan with the bank. If your ex keeps the house but your name is still on the mortgage, you are 100% liable. If they miss a payment, your credit is destroyed.18 You must demand they refinance the loan in their name only.75
Pros and Cons: Should You Be the One to Keep the House?
| Pros (Why You Might Want to Keep It) | Cons (The Hidden Risks & Costs) |
| ✅ Stability for Children: This is the #1 reason. It keeps children in their schools and familiar surroundings.21 | ❌ The Carryover Basis Trap: You are inheriting a massive, hidden tax liability.26 |
| ✅ Emotional Attachment: It’s your home. The desire to stay is a powerful emotional driver.22 | ❌ Refinancing is Hard & Expensive: You must qualify for a new loan on your single income.75 Interest rates are likely higher, and there are new closing costs.95 |
| ✅ Avoids a Bad Market: If the housing market is down, a buyout avoids selling at a loss.22 | ❌ You Become “House Poor”: You may end up with all your assets tied up in one property, with no cash or retirement funds left.21 |
| ✅ Avoids Moving: Moving is expensive and incredibly stressful, especially during a divorce.21 | ❌ Full Responsibility: You are now 100% responsible for all property taxes, insurance, utilities, and expensive surprise repairs.18 |
| ✅ Future Appreciation: You get to keep all future profit on the property. | ❌ Lingering Emotional Triggers: For some, the house is full of bad memories. Staying can make it harder to move on emotionally.49 |
Do’s and Don’ts for Your Marital Home
- ✅ DO assemble your own independent team: a family law attorney, a CPA, and a CDFA.27
- ✅ DO get a professional appraisal to determine the home’s Fair Market Value.75 Do not guess or use a website.
- ✅ DO calculate the after-tax value of all assets.3 $100,000 in cash is worth more than a $100,000 house with a hidden tax bill.
- ✅ DO demand a refinance. If your ex-spouse keeps the house, your divorce decree must require them to refinance the mortgage in their name only by a specific date.18
- ✅ DO push to sell before the divorce is final (by Dec. 31st) if your gain is over $250,000. That $500,000 joint exclusion is worth fighting for.45
- ❌ DON’T make financial decisions based purely on emotion.54 A house is a financial asset. Treat it like one.
- ❌ DON’T forget the “hidden costs” of selling, such as realtor commissions, repairs, and staging, which can be 5-8% of the sale price.95
- ❌ DON’T stay on as a “co-owner” after the divorce unless absolutely necessary. It keeps you financially entangled with your ex 18 and creates the “Out-Spouse” tax problem.45
- ❌ DON’T use your joint financial advisor. It is a massive conflict of interest.86
- ❌ DON’T transfer the house to a non-resident alien spouse. This is the biggest exception. The transfer is a taxable sale.24
Frequently Asked Questions (FAQs)
Q: So, just to be clear, can I “defer” my capital gains when I sell my marital home?
A: No. The old “deferral” or “rollover” rule from before 1997 is gone.3 You now permanently exclude (erase) the profit using the Section 121 exclusion.
Q: Will I pay taxes if my spouse just buys me out?
A: No. A buyout between spouses as part of a divorce is a tax-free transfer under Section 1041.12 No gain is recognized at that time.
Q: Is it better to sell the house before or after the divorce is final?
A: Usually before. Selling while legally married (by Dec. 31st) lets you file a joint return and claim the larger $500,000 exclusion.44
Q: I moved out of the house two years ago. Do I lose my $250,000 tax exclusion when we sell?
A: Yes, you will fail the residency test, unless your final divorce decree includes specific “magic words” from IRC § 121(d)(3)(B).27 This saves your $250,000 exclusion.
Q: What is my home’s “basis”?
A: It is your home’s original purchase price plus the cost of any major capital improvements (like a new roof or kitchen remodel), not minor repairs.25
Q: Does my mortgage balance affect my capital gains tax?
A: No, not at all. Your mortgage balance has zero impact on your capital gains calculation.30 The profit is your sale price minus your basis.
Q: What is the “Carryover Basis Trap”?
A: It’s the hidden tax. The spouse who keeps the house in a buyout also keeps the couple’s original low basis, creating a massive, built-in tax liability for them in the future.
Related reading
- Can I Move Into My Rental Property to Avoid Capital Gains Tax? + FAQs
- How Does Step-Up in Basis Impact Estate Investment Sales? (w/Examples) + FAQs
- 17 Most Common Tax Mistakes Made During Divorce (w/Examples) + FAQs
- Can a Divorce Buyout Be a Taxable Sale? (w/Examples) + FAQs
- What Assets Do Not Qualify for the Marital Deduction? (w/Examples) + FAQs
- Does Community Property Get a Double Step-Up in Basis? (w/Examples) + FAQs
- What Happens if You Get Divorced Without a Prenup? (w/Examples) + FAQs