Maryland
Capital Gains Tax When You Sell the Marital Home
Under IRS Topic no. 701, you exclude up to $250,000 of gain on the sale of your home from income, or up to $500,000 if you file a joint return with your spouse. You must meet the ownership and use tests. Who sells and when changes which limit applies. Run the numbers with your CPA before you list.
By Marc Cormier
Licenses: Maryland #620443 | Virginia #0225175181 | DC #SP98365998 | Berkshire Hathaway HomeServices
27+ years in real estate. 800+ closed transactions.
Certified as a Certified Divorce Real Estate Expert (CDRE) in 2014.
Last updated: October 2, 2026
On this page
What does IRS Topic no. 701 say about excluding gain?
IRS Topic no. 701, Sale of your home, says you qualify to exclude up to $250,000 of gain from your income, or up to $500,000 if you file a joint return with your spouse. The page was last reviewed September 24, 2026.
The tests are plain.
- Ownership test: you owned the home at least 24 months of the last 5 years before the sale.
- Use test: you used it as a residence at least 24 months of the previous 5 years.
- On a joint return, either spouse meets the ownership test and both spouses meet the use test individually.
IRS Publication 523, Selling Your Home, gives the full rules. Everything after these lines on this page is general explanation or a worked example. Your CPA applies the rules to your return.
How do three divorce cases change the result?
The same house produces three different results depending on who owns it, who sells, and when.
Start with the facts. The couple bought the home for $300,000. It sells for $700,000. Both spouses lived there as their main home for at least 24 months of the last 5 years. Both own it.
To keep the math simple, this example defines gain as the sale price minus the purchase price. Your CPA adjusts the figure for your own records. $700,000 minus $300,000 equals $400,000.
| Case | Who sells and when | Exclusion limit | Gain above the limit on $400,000 |
|---|---|---|---|
| A | Both spouses sell and file a joint return | $500,000 | $0 |
| B | One spouse keeps the house after the divorce and sells alone later | $250,000 | $150,000 |
| C | Both still own the house and sell after the divorce. The gain splits evenly at $200,000 each | $250,000 each | $0 each |
The math, step by step.
- Case A: $400,000 gain minus $500,000 limit is below zero. Gain above the limit is $0.
- Case B: $400,000 gain minus $250,000 limit equals $150,000 above the limit.
- Case C: $400,000 divided by 2 equals $200,000 each. Each spouse's $200,000 is below $250,000. Gain above the limit is $0 each.
Case C rests on two assumptions. The spouses split the gain evenly. Each former spouse applies a $250,000 limit to a half share. Topic no. 701 and Publication 523 are the sources for the limits. Ask your CPA whether Case C works on your facts and dates.
What the table shows: in this example, Case B leaves the most gain above the limit. A spouse who keeps the house and sells alone later faces the $250,000 figure, not $500,000.
If keeping the home does not work, here is how a divorce sale runs.
What if the gain is larger?
A larger gain shows the difference between the limits faster. Use the same couple with a higher sale price.
The home sells for $900,000. Purchase price is $300,000. $900,000 minus $300,000 equals $600,000 of gain.
| Case | Exclusion limit | Gain above the limit on $600,000 |
|---|---|---|
| A | $500,000 | $100,000 ($600,000 minus $500,000) |
| B | $250,000 | $350,000 ($600,000 minus $250,000) |
| C | $250,000 each | $50,000 each ($300,000 minus $250,000) |
Case B leaves $350,000 above the limit. Case A leaves $100,000. This is the gap to price before you decide who keeps the house.
This page states no tax rate. The rate on gain above the limit depends on your return. Ask your CPA.
Which records should you gather before you sell?
Gather the purchase documents, the closing statement from your purchase, and every invoice for work done on the home. Your CPA decides which figures go into the gain calculation.
- Closing statement from the purchase.
- Contractor invoices, permits, and proof of payment for major work.
- Dates each spouse lived in the home and dates each spouse owned it.
- Any divorce or separation instrument that covers who lives in the home.
- The closing statement from the sale, when you have it.
I tell people to build the folder now, before the listing, not after the sale. Without records, your CPA works from guesses.
What does IRS Publication 523 say about a former spouse who lives in the home?
IRS Publication 523 says that if you are a sole or joint owner and your former spouse is allowed to occupy the home under a divorce or separation instrument and lives there as a principal residence, you treat the property as your own residence for the exclusion.
Publication 523 defines a divorce or separation instrument as one of three things.
- A decree of divorce or separate maintenance, or a written instrument incident to that decree.
- A written separation agreement.
- A decree requiring a spouse to make support or maintenance payments.
Maryland Family Law Article section 8-208(d) adds one related line. An order granting sole possession does not affect the other party's right to claim the family home as a principal residence for tax purposes. Ask your CPA whether your order or agreement fits the Publication 523 definition. See "Use and Possession of the Family Home in Maryland."
Does the filing year matter?
Yes. Topic no. 701 ties the $500,000 limit to a joint return with your spouse. Your return for the year of the sale decides which limit you use.
Ask your CPA how your marital status and filing status line up with the closing date. A closing in late December and a closing in early January fall in different tax years. Settle that question before you accept a closing date.
What this means for your house
- Your result depends on who owns the house, who sells it, and which return you file.
- Topic no. 701 sets $500,000 for a joint return and $250,000 otherwise.
- A spouse who buys out the other and sells later alone works from the $250,000 figure.
- Publication 523 covers a former spouse who lives in the home under a divorce or separation instrument.
- Records matter. Start the folder now.
- Maryland transfer and recordation taxes are separate from the federal exclusion. Ask your title company.
- Ask your CPA before you sign a listing agreement.
Where does this go wrong?
The tax bill arrives after the money is spent. That is the usual mistake.
- Skipping the CPA until after closing.
- Assuming the $500,000 limit follows you after the divorce. Topic no. 701 ties it to a joint return.
- Losing records. Your CPA has less to work with.
- Picking a closing date without asking how the filing year works.
- Treating a buyout as free of tax questions. The spouse who keeps the house and sells later alone works from the $250,000 figure.
- Using the exclusion math without the 24-month tests. A spouse who moved out long ago needs a CPA to check the dates against Publication 523.
- Choosing the sale date on emotion. I have seen this mistake before, and the tax bill is the price.
Local note for Montgomery County: The Montgomery County Circuit Court runs a Family Law Self-Help Center. It is a free walk-in clinic staffed by attorneys, in the South Tower, First Floor, Room 1500. It gives general legal information or limited legal advice on divorce, custody, and related matters. You still pay case fees and costs. Source: https://www.montgomerycountymd.gov/circuit-court/services/family-law-self-help-center
Questions about capital gains and the marital home
Q1. Do we pay capital gains tax when we sell?
Tax applies only to gain above your exclusion. IRS Topic no. 701 lets you exclude up to $250,000 of gain from income, or up to $500,000 with a joint return filed with your spouse, once you meet the ownership and use tests. Your CPA confirms your case. Ask your title company about state tax and Maryland transfer and recordation taxes.
Q2. Is it better to sell before the divorce is final?
Run the cases first. This post's made-up example shows why. A spouse who keeps the house and sells alone later works from the $250,000 limit, not $500,000, and $400,000 of gain leaves $150,000 above it. Topic no. 701 sets up to $500,000 for a joint return and up to $250,000 otherwise. Ask your CPA to run your numbers before you accept a closing date.
Q3. How does the $500,000 versus $250,000 exclusion work?
The $500,000 limit belongs to joint returns. Topic no. 701 allows up to $500,000 when you file jointly with your spouse. Ownership needs one spouse and use needs both, each on their own record. Every other filer gets up to $250,000. Ask your CPA whether two former spouses each apply $250,000 to a half share.
Q4. What do the ownership and use tests require?
Each test counts 24 months inside the 5 year window before the sale. Own the home for at least 24 months of the last 5 years. Use it as a residence for at least 24 months of the previous 5 years. On a joint return, either spouse satisfies ownership and both satisfy use individually. The source is Topic no. 701.
Q5. Does the spouse who moves out still qualify for the exclusion?
Publication 523 covers the spouse who moved out. Say you are a sole or joint owner, and your former spouse occupies the home as a principal residence under a divorce or separation instrument that allows it. You then treat the property as your own residence for the exclusion. Your CPA applies the rule to your dates.
Q6. Does a use and possession order affect my tax claim to the home?
Not under the statute text. Maryland Family Law Article section 8-208(d) leaves the other party's tax right intact when an order grants sole possession. That party keeps the right to claim the family home as a principal residence for tax purposes. Publication 523 defines a divorce or separation instrument. Your CPA checks whether your order or agreement meets that definition.
Q7. Which records should I gather before I sell?
Build the folder before the listing goes up. Without records, your CPA works from guesses. Collect your purchase closing statement, contractor invoices and proof of payment for major work, and the dates each spouse owned the home and lived there. Add any divorce or separation instrument. Your CPA decides which figures enter the gain calculation.
Do you need a divorce attorney?
You should have your own. I am a real estate agent. I do not give legal advice, and I do not work for one spouse against the other.
I am not affiliated with any law firm. I do not recommend one attorney over another. Your spouse needs their own attorney, not yours.
If you need to find one, start with these bar association resources:
- Maryland State Bar Association, For the Public (points you to your county bar association)
- Bar Association of Montgomery County, Maryland, Lawyer Referral Service
Links open in a new tab.
| What an attorney handles | What I handle |
|---|---|
| Who gets the house and the money | The value of the house |
| The marital settlement agreement | The net sheet |
| Court orders that affect the sale | Listing, showings, offers, and closing |
| Custody, support, and everything outside real estate | A written record of every showing and decision |
General information only. Not legal, tax, or financial advice. The referral services are independent of me. I do not guarantee any attorney's work or results.
About the Author
Marc Cormier
Licenses: Maryland #620443 | Virginia #0225175181 | DC #SP98365998 | Berkshire Hathaway HomeServices
Co-author of "Cracking the Real Estate Code," a best seller in four Amazon categories on release day, September 2013.
PRWeb, September 13, 2013.
Certified as a Certified Divorce Real Estate Expert (CDRE) in 2014.
Sources
Related reading
- Can You Sell a House Before the Divorce Is Final in Maryland?
- How to Buy Out Your Spouse's Share of the House
- Use and Possession of the Family Home in Maryland
- Divorce After 50 and the House
- Selling or Keeping the House in a Maryland Divorce
- What each spouse gets from a divorce home sale (net sheet)
- Should we sell before or after the divorce is final?
General information only. Not legal, tax, or financial advice. Talk to your own attorney and tax professional about your situation.
Free Book
A free guide to selling an inherited home. Form coming soon.
Want to talk through your house and your options?
Talk With Marc.
15 minutes. Free. No pressure.