Capital Gains Tax When You Sell Your House at Divorce

Learn how the IRS rules on capital gains taxes apply when you sell your family home during or after divorce.

By , Attorney · UC Berkeley Law
Updated by E.A. Gjelten, Legal Editor

If your marriage is ending and you own a house or condo, the issue of what happens to the family home in divorce can be difficult. Along with the other considerations, you'll need to think about the potential tax consequences.

Not surprisingly, the IRS has complicated rules on when the capital gains tax applies to the sale of a family home. Many of those rules work in favor of couples who transfer or sell their house as part of the property division in their divorce. As with everything related to taxes, however, you need to understand the details in the rules.

Tax Treatment of a House Buyout Between Divorcing Spouses

If one spouse will keep the family home as part of a buyout during divorce—for instance, by refinancing or exchanging the house for other marital assets like retirement accounts—the other spouse typically won't have to pay capital gains taxes on the sale. That's because the IRS generally doesn't recognize any gain (or loss) on a transfer of property between spouses. This tax treatment also applies to a property transfer between former spouses if it was "incident" to the divorce, meaning that it:

  • took place within one year after your divorce was final, or
  • was called for under the original or modified divorce decree and took place within six years after the marriage ended.

Even if you don't meet the six-year time limit, you still might qualify for the tax exemption if you can prove that it was part of the property division in your divorce. (See IRS Pub. 504 (2024))

Capital Gains Taxes When You Sell the Family Home to a Third Party

Whether they want to or not, many couples end up selling their house as part of their divorce and dividing the proceeds. When that happens, they might have to pay capital gains taxes if the property is worth more than when they bought it. The same is true for a spouse who keeps the home after a buyout in divorce and then later sells the property. As discussed above, the tax wouldn't apply to the buyout—but it would apply to the subsequent sale.

However, the IRS allows qualifying homeowners to exclude from taxable income up to $250,000 of the gain on the sale. The exclusion goes up to $500,000 for couples who sell their home together. (More below on the requirements for this exclusion.)

The "gain" on a home sale is not only the difference between the property's original price and the sale price. Rather, gain is the selling price minus:

  • the costs of selling the property
  • deductible closing costs, and
  • the tax "basis" in the property.

As with many tax rules, it's complicated to understand the tax basis of a home. But it generally means the original purchase or building cost, plus certain other costs (such as improvements and renovations) and minus things like insurance payments for casualty losses.

Qualifying for the Capital Gains Tax Exclusion on Home Sales

To qualify for the $250,000/$500,000 exclusion on capital gains taxes for home sales, you must meet two basic requirements. For a total of two years out of the five years just before the sale date, you must have

  • owned the home, and
  • lived in the home as your principal residence.

For both the ownership and residency requirements, the two years don't have to be consecutive. Also, you don't need to be living in the home at the time of the sale, as long as it was your principal residence for at least two years during the previous five-year period.

As always, there are some exceptions to the eligibility test. (See the details in IRS Pub. 523 (2024).)

What If You Continue to Co-Own the House After Divorce?

You and your spouse may agree (or the judge may order) that you'll continue to co-own the family home for some time after the divorce. For instance, you may decide it's best for the children if the custodial parent stays in the home until the kids are grown, but you can't afford a buyout—or you'd prefer to wait to sell the house for financial reasons.

Although it's not common, a judge might order co-ownership even if you and your spouse don't agree. The laws in a few states allow (or even require) judges to consider whether it would be beneficial for the custodial parent to stay in the family home with the children for a while after the divorce. In California, for instance, judges may order a deferred sale of the home after divorce if the parents can afford it.

Once the period of co-ownership is over, the tax consequences will depend on what you do with the house next:

  • Buyout: If one of you will keep the house through some form of buyout, you might not have to pay taxes on the transaction, as long as you meet the requirements for a transfer related to divorce (discussed above).
  • Sale: If you sell the house to a third party, capital gains taxes would apply to the sale. But you may meet the requirements for the capital gains exclusion, even if only one of you has been living in the house. Under the IRS rules on the capital gains exclusion, you may treat a home as your residence when your ex was allowed to live there under your divorce agreement, as long as you continued to own the property as the sole or joint owner.

Either way, you'll need to make sure that you put all the details of your co-ownership agreement in writing and submit the signed agreement to the court for a judge's approval, so that it will be part of an official court order.

Getting Help With Home Sales and Taxes

Whatever you and your spouse decide to do with the family home as part of your divorce, you should understand how it will affect your immediate and long-term finances, including the tax consequences. The IRS publications explain the rules in detail, but they aren't necessarily easy to understand. If at all possible, this is a time to at least speak with a tax professional or an experienced family law attorney to help you decide on a plan that will meet your needs while reducing your tax liability.

Considering Divorce?
Talk to a Divorce attorney.
We've helped 85 clients find attorneys today.
There was a problem with the submission. Please refresh the page and try again
Full Name is required
Email is required
Please enter a valid Email
Phone Number is required
Please enter a valid Phone Number
Zip Code is required
Please add a valid Zip Code
Please enter a valid Case Description
Description is required

How It Works

  1. Briefly tell us about your case
  2. Provide your contact information
  3. Choose attorneys to contact you