How Divorce Affects Capital Gains Tax When You Sell Your Home

Before you decide what to do with the family home, learn how the IRS taxes home sales in a divorce.

By , Attorney UC Berkeley Law
Updated by Stacy Barrett, Attorney UC Law San Francisco
Updated 2/20/2026

If your marriage is ending and you own a house or condo, deciding what happens to the family home can be hard. In addition to thinking about equity and the memories you created in the home, you also need to think about how your choice could affect your taxes.

The IRS has detailed and complicated rules about when capital gains tax applies to the sale of a family home. Some of the rules help divorcing couples who transfer or sell their house as part of dividing their property in their divorce, but it's important to understand how they work.

House Buyouts Between Divorcing Spouses

If one spouse keeps the family home as part of a buyout during divorce, the other spouse typically won’t owe capital gains tax on that transfer. This can happen if the spouse keeping the home refinances the mortgage or trades other marital assets, such as retirement accounts, in exchange for the house.

In general, the IRS doesn’t treat a transfer of property between spouses as a taxable gain or loss. The same rule applies to a property transfer between former spouses if it's “incident” to the divorce, meaning that it:

  • happens within one year after the divorce is final, or
  • is required by a divorce judgment or agreement and happens within six years after the marriage ends.

Even if the transfer happens more than six years after the divorce, it might still qualify, but only if specific obstacles prevented the buyout from happening sooner, and the transfer happened as soon as the obstacles were removed. (See IRS Pub. 504, Divorced or Separated Individuals.)

Capital Gains Taxes When You Sell the Family Home to Someone Else

Many divorcing couples end up selling the family home when they divorce and then splitting the money. When you do this, you might have to pay capital gains taxes if the home is worth more than it was when you bought it. The same is true if one spouse keeps the house in the divorce and then sells it later. The buyout itself is typically not taxed, but the later sale can be.

The IRS allows many sellers to exclude part of their gain from income. A qualifying homeowner can exclude up to $250,000 of the gain from tax. A married couple can exclude up to $500,000 if they meet the rules.

Your “gain” from the home sale isn't just the difference between what you paid for the house and what you sold it for. Instead, your gain is the selling price minus:

  • the costs of selling the property (such as real estate agent fees), and
  • your tax “basis” in the property.

Your tax basis is usually what you paid to buy or build the home, plus certain costs such as major improvements and renovations. Figuring out the basis can be complex, so it may help to talk with a tax professional.

Qualifying for the Capital Gains Tax Exclusion for Homeowners

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

  • owned the home, and
  • used the home as your main residence.

The two years don't have to be in a row. But you must not have excluded the gain from the sale of another home in the two years before this sale.

As always, there are some exceptions to these IRS rules. (See the details in IRS Pub. 523, Selling Your Home.)

Co-Owning the House After Divorce?

You and your spouse might agree, or the judge might order, that you’ll continue to co-own the family home for some time after the divorce. For example, you may decide it’s best for the children if the custodial parent stays in the home until the kids are older. You might also decide to delay a sale for financial reasons or because a buyout isn't affordable right away.

Although it's not common, a judge might order co-ownership even if you and your spouse don't agree. In some states, judges may 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 example, a judge may order a deferred sale of the family home, meaning the sale will take place later rather than at the time of the divorce, if the parents can afford this option.

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

  • Buyout: If one of you keeps the home through a buyout, the transfer might not be taxed, as long as it meets the rules for a transfer related to divorce.
  • Sale: If you sell the home to someone else, capital gains tax rules will apply. But you may still qualify for the capital gains exclusion, even if only one of you lived in the home. Under the IRS rules, you may treat the home as your residence when your ex was allowed to live there under your divorce judgment or agreement and you continued to own the property.

Whatever you decide, 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

Decisions about the family home can have a big impact—emotionally and financially during and after divorce. IRS publications describe the rules, but they can be hard to follow.

If you can afford it, talk to a tax professional, a family law attorney, or both. They can help you understand your choices, plan for taxes, and choose a property division plan that works for your situation.

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