# Capital Gains Home Sale Exclusion (Section 121): Complete Guide

> Exclude up to $250K (single) or $500K (married) in capital gains when selling your primary residence. Ownership and use tests, partial exclusions, depreciation recapture, and reporting.

**Category**: Income & Taxes  
**Parent Calculator**: [capital-gains-calculator](https://www.digitalcalculator.info/capital-gains-calculator/)  
**URL**: https://www.digitalcalculator.info/capital-gains-calculator/home-sale-exclusion/  
**Last Updated**: 2026-09-28

How to exclude up to $250,000 (single) or $500,000 (married) in capital gains when selling your primary residence — ownership and use tests, partial exclusions, depreciation recapture, and reporting requirements.

- **$250,000**: Single-filer exclusion
- **$500,000**: Married filing jointly exclusion
- **2 of 5**: Years owned & lived in (primary residence)

## Quick Answer

**Do you owe capital gains tax when selling your home?** In most cases, no. Under IRC Section 121, you can exclude up to:

-   **$250,000** in capital gains if you are a single filer
-   **$500,000** in capital gains if you are married filing jointly

To qualify, you must have **owned and lived in the home for at least 2 of the last 5 years** before the sale. You can use this exclusion repeatedly — there is no lifetime limit — but generally not more than **once every 2 years**.

**Bottom line:** According to the National Association of Realtors, the median existing-home sale price was **$434,100** as of July 2026 (existing-home sales release, August 2026). Most homeowners' gains fall well within the exclusion limits, meaning **zero federal capital gains tax** on their home sale.

[Estimate Your Home Sale Capital Gains →](https://www.digitalcalculator.info/capital-gains-calculator/)

> ### Key Takeaways
> 
> -   Section 121 lets you exclude up to **$250,000** (single) or **$500,000** (married filing jointly) in capital gains from a primary residence sale
> -   You must meet both the **ownership test** and the **use test**: own and live in the home for at least 2 of the 5 years before selling
> -   A **partial exclusion** is available if you sell early due to a job change, health issue, or unforeseen circumstance
> -   The exclusion does **not** apply to depreciation recapture — home office or rental depreciation is taxed at up to 25%
> -   You can use the exclusion **repeatedly** with no lifetime cap, but generally not more than once every 2 years
> -   Second homes, vacation properties, and rental-only properties do **not** qualify unless converted to a primary residence

## What Is the Section 121 Home Sale Exclusion?

Internal Revenue Code (IRC) Section 121 allows homeowners to exclude a significant amount of capital gains from federal income tax when they sell their primary residence. This provision, outlined in detail in [IRS Publication 523](https://www.irs.gov/publications/p523), is one of the most valuable tax benefits available to individual taxpayers.

The exclusion amounts have not changed since 1997, when the Taxpayer Relief Act replaced the previous one-time exclusion (which was limited to sellers age 55 and older) with the current repeatable structure:

*Section 121 Maximum Exclusion Amounts*

| Filing Status | Maximum Exclusion | Frequency |
| --- | --- | --- |
| Single | **$250,000** | Once every 2 years |
| Married Filing Jointly | **$500,000** | Once every 2 years |
| Married Filing Separately | **$250,000** each | Once every 2 years (each spouse) |

To claim the full $500,000 married exclusion, **both spouses** must meet the use test (lived in the home as a primary residence for 2 of the last 5 years), and at least **one spouse** must meet the ownership test. Neither spouse can have used the exclusion on another home sale in the prior 2 years.

> **Important:** These exclusion amounts are **not indexed for inflation**. The $250,000 and $500,000 figures have remained the same since 1997 and are not expected to change unless Congress passes new legislation.

## The 2-of-5-Year Ownership and Use Tests

To qualify for the full Section 121 exclusion, you must pass **two separate tests** during the 5-year period ending on the date of sale:

### Ownership Test

You must have **owned** the home for at least 24 months (730 days) during the 5-year period before the sale. The 24 months do not need to be consecutive. If you owned the home through a single-member LLC or revocable trust, you generally still meet this test.

### Use Test

You must have **used the home as your principal residence** for at least 24 months during the same 5-year period. Again, the months do not need to be consecutive. Short temporary absences (such as a vacation or seasonal travel) typically count toward the 24-month requirement. The IRS considers factors such as:

-   Where you receive mail and maintain your driver's license
-   The address on your tax returns and voter registration
-   Proximity to where you work, bank, and attend religious services
-   Where your household members (dependents, spouse) reside

### Timing Test

You generally cannot use the exclusion if you already excluded gain from another home sale within the **2-year period** ending on the date of the current sale. This prevents "serial flipping" with tax-free gains.

### Example: Meeting the Tests

Sarah purchased her home on March 1, 2021, moved in on the same date, and lived there continuously. She sells the home on June 15, 2026.

-   **Ownership test:** Sarah has owned the home for over 5 years (March 2021 to June 2026). She passes.
-   **Use test:** She has used the home as her primary residence for the entire period. She passes.
-   **Timing test:** She has not excluded gain from another home sale in the past 2 years. She passes.

Sarah qualifies for the full $250,000 exclusion as a single filer.

> **Non-consecutive use:** You can rent out your home for part of the 5-year window and still qualify. For example, if you lived in the home for 2 years, rented it out for 2 years, then sold it in year 5, you would still meet the 2-of-5-year use test. However, gain attributable to "non-qualifying use" periods after December 31, 2008, may not be fully excludable.

## How to Calculate Your Capital Gain on a Home Sale

Your capital gain is the difference between your **amount realized** (what you received from the sale) and your **adjusted basis** (what you paid, plus improvements, minus depreciation). Here is the formula:

> **Formula:** Capital Gain = (Sale Price - Selling Expenses) - (Purchase Price + Buying Costs + Capital Improvements - Depreciation Claimed)

### Step 1: Determine Your Adjusted Basis

Your adjusted basis starts with the original purchase price and is modified by:

*What Increases and Decreases Your Cost Basis*

| Increases to Basis | Decreases to Basis |
| --- | --- |
| Original purchase price | Depreciation claimed (home office, rental) |
| Closing costs at purchase (title insurance, transfer taxes, recording fees) | Casualty loss deductions claimed |
| Capital improvements (additions, renovations, new roof, HVAC) | Insurance reimbursements for losses |
| Special assessments for local improvements | Energy credits claimed on improvements |

**Important distinction:** Routine maintenance and repairs (painting, fixing leaks, replacing broken hardware) do **not** increase your basis. Only **capital improvements** — work that adds value, prolongs the life, or adapts the property to new uses — count. Per IRS Publication 523, examples include adding a bathroom, replacing the entire roof, or installing central air conditioning.

### Step 2: Calculate the Gain

Subtract your adjusted basis from the amount realized (sale price minus selling expenses like agent commissions, title fees, and transfer taxes).

### Example 1: Single Filer — Gain Fully Excluded

*Example: Single Filer with $167,000 Gain*

| Item | Amount |
| --- | --- |
| Sale price | $550,000 |
| Selling expenses (6% commission + closing costs) | -$33,000 |
| **Amount realized** | **$517,000** |
| Original purchase price | $300,000 |
| Buying closing costs | +$8,000 |
| Capital improvements (kitchen remodel, new roof) | +$42,000 |
| **Adjusted basis** | **$350,000** |
| **Capital gain** | **$167,000** |
| Section 121 exclusion (single) | -$167,000 |
| **Taxable gain** | **$0** |

Since the $167,000 gain is below the $250,000 single exclusion, this homeowner pays **zero federal capital gains tax**.

### Example 2: Married Couple — Gain Exceeds Exclusion

*Example: Married Couple with $620,000 Gain*

| Item | Amount |
| --- | --- |
| Sale price | $1,200,000 |
| Selling expenses | -$72,000 |
| **Amount realized** | **$1,128,000** |
| Original purchase price | $420,000 |
| Buying costs + improvements | +$88,000 |
| **Adjusted basis** | **$508,000** |
| **Capital gain** | **$620,000** |
| Section 121 exclusion (married) | -$500,000 |
| **Taxable gain** | **$120,000** |

This couple owes long-term capital gains tax on $120,000. At the 15% rate (the most common bracket for 2026), that is approximately **$18,000 in federal tax**. If their modified adjusted gross income exceeds $250,000 (MFJ threshold), they may also owe the **3.8% net investment income tax (NIIT)** on some or all of that $120,000, adding up to $4,560 for a total of approximately $22,560.

[Calculate Your Home Sale Capital Gains Tax →](https://www.digitalcalculator.info/capital-gains-calculator/)

## Partial Exclusion: When You Sell Before 2 Years

If you do not meet the full 2-of-5-year requirement, you may still qualify for a **reduced (partial) exclusion** if the sale was triggered by one of three IRS-recognized circumstances:

### 1\. Change in Place of Employment

Your new workplace is at least **50 miles farther** from the home than your previous workplace. This mirrors the distance test for the moving expense deduction. A qualifying job change includes starting a new job, being transferred, or being relocated by your employer.

### 2\. Health Reasons

You sell to obtain, provide, or facilitate diagnosis, cure, mitigation, or treatment of a disease, illness, or injury for yourself, a family member, or a household member. A doctor's recommendation to move (for example, due to severe allergies or a medical condition worsened by the home environment) generally qualifies.

### 3\. Unforeseen Circumstances

The IRS lists several qualifying events, including:

-   Death of a spouse or co-owner
-   Divorce or legal separation
-   Job loss that qualifies for unemployment compensation
-   A change in employment that leaves you unable to pay the mortgage
-   Multiple births from the same pregnancy (twins, triplets)
-   Damage to the home from a natural disaster, war, or terrorism
-   Condemnation, seizure, or involuntary conversion of the property

### Calculating the Partial Exclusion

The partial exclusion is based on the fraction of the 2-year requirement you completed:

> **Formula:** Partial Exclusion = Maximum Exclusion x (Days of qualifying use / 730 days)

### Example 3: Partial Exclusion for Job Relocation

Tom (single filer) purchased his home on January 1, 2025, and lived in it as his primary residence. On January 1, 2026, he receives a job transfer to another state and sells the home after 12 months of ownership and use.

-   **Time lived in home:** 365 days out of 730 required = 50%
-   **Partial exclusion:** $250,000 x 50% = **$125,000**
-   **Capital gain on sale:** $90,000
-   **Taxable gain:** $0 (the $90,000 gain is fully covered by the $125,000 partial exclusion)

## Depreciation Recapture (Section 1250)

The Section 121 exclusion does **not** cover gains attributable to depreciation. If you claimed depreciation deductions on any portion of your home — typically from a **home office** or from **renting out part of the property** — you must pay depreciation recapture tax under IRC Section 1250.

### How Depreciation Recapture Works

-   Depreciation recapture is taxed at a maximum federal rate of **25%** (this is a special rate, not your ordinary income rate or capital gains rate)
-   The recapture amount equals the total depreciation you claimed (or were allowed to claim, even if you did not)
-   Recapture is calculated **before** the Section 121 exclusion is applied to the remaining gain

### Example 4: Home Office Depreciation Recapture

Maria (single) sells her home with a total capital gain of $200,000. Over the years, she claimed $15,000 in home office depreciation deductions.

*Depreciation Recapture Example*

| Component | Amount | Tax Treatment |
| --- | --- | --- |
| Total capital gain | $200,000 | -- |
| Depreciation recapture (Section 1250) | $15,000 | Taxed at up to 25% = **$3,750** |
| Remaining gain | $185,000 | Excluded under Section 121 |
| **Total tax owed** | **$3,750** (depreciation recapture only) |  |

Even though Maria's total gain ($200,000) is below the $250,000 single exclusion, she still owes $3,750 on the depreciated portion. The remaining $185,000 gain is fully excluded.

> **Warning:** Depreciation recapture applies even if you stopped using the home office before the sale. If you claimed depreciation at any point, you must recapture it. Consider consulting a tax professional to ensure you calculate the recapture amount correctly.

## Multiple Homes and Special Situations

### Second Homes and Vacation Properties

The Section 121 exclusion applies **only to your primary residence**. Gains on the sale of a second home, vacation property, or investment property are fully subject to capital gains tax. However, there are two important scenarios to consider:

-   **Converting a second home:** If you convert a vacation home to your primary residence and live in it for at least 2 of the 5 years before selling, you may qualify for the exclusion. However, gain allocable to periods of "non-qualifying use" after December 31, 2008, is generally not excludable (per the Housing Assistance Tax Act of 2008).
-   **1031 exchange properties:** If you acquired your current home through a Section 1031 like-kind exchange, you cannot use the Section 121 exclusion unless you have owned the property for at least 5 years after the exchange.

### Example 5: Converting a Rental Property

James bought a rental property in 2019 and rented it for 4 years. In 2023, he moved into the property and used it as his primary residence. He sells in 2026 after 3 years of personal use.

-   **Ownership test:** Owned since 2019 — passes
-   **Use test:** Lived in it from 2023 to 2026 (3 years) — passes
-   **Non-qualifying use:** 4 years of rental use out of the total ownership period are considered non-qualifying use after 2008
-   **Result:** A portion of the gain (the fraction attributable to the non-qualifying rental period) is **not** eligible for the Section 121 exclusion. James would also owe depreciation recapture on any rental depreciation claimed.

### Divorced or Separated Homeowners

Two separate rules apply, and they help different spouses. **Ownership:** if your spouse or former spouse transferred the home to you, in a divorce or otherwise, you can count the time they owned it as time you owned it. You must still meet the 2-year use test on your own — their time living there does not count as yours. **Use:** if you still own the home after moving out, and your spouse or former spouse is allowed to live in it under a divorce or separation instrument, you are treated as using it as your residence while they live there. This can be important if you moved out more than 3 years before the sale — the time your former spouse continued living there under the decree or agreement still counts toward your use test (IRC §121(d)(3); IRS Publication 523).

### Surviving Spouses

If your spouse dies and you sell the home within **2 years** of the date of death, you may claim the full **$500,000 exclusion** if you have not remarried at the time of the sale and you and your spouse met the joint-filer requirements immediately before the death (either of you met the ownership test and both of you met the use test), and neither of you excluded gain on another home sold in the 2 years before this sale. The rule does not depend on your filing status: it applies to an unmarried surviving spouse who files as single. If you have not remarried, you can also count your late spouse's ownership and use toward the 2-of-5-year tests. After the 2-year window, the $250,000 single limit applies (IRC §121(b)(4) and (d)(2); IRS Publication 523).

Additionally, the deceased spouse's share of the home typically receives a **stepped-up basis** to its fair market value at the date of death, which can significantly reduce or eliminate the taxable gain.

### Military, Foreign Service, and Intelligence Personnel

Members of the uniformed services, Foreign Service, and intelligence community can elect to **suspend the 5-year test period** for up to 10 years during qualified official extended duty. This means the 5-year look-back window can effectively become a 15-year window, making it easier to meet the 2-year use test even after a long deployment or assignment.

## Reporting Your Home Sale on Your Tax Return

How you report depends on whether the gain is fully excluded or partially taxable.

### If the Gain Is Fully Excluded

-   If you **did not receive** a Form 1099-S from the closing agent, you generally do not need to report the sale on your tax return at all
-   If you **did receive** a Form 1099-S, you should report the sale on **Schedule D** (Form 1040) and enter the exclusion to show that no tax is due
-   Either way, keep records of the purchase price, improvements, and sale details for at least 3 years after filing

### If the Gain Exceeds the Exclusion

1.  Report the sale on **Form 8949** (Sales and Other Dispositions of Capital Assets)
2.  Transfer totals to **Schedule D** (Form 1040)
3.  The excluded portion reduces your reported gain; you pay tax only on the excess
4.  If depreciation recapture applies, report it as "unrecaptured Section 1250 gain" on Schedule D

### If You Claim a Partial Exclusion

Report the sale on Form 8949 and Schedule D, and include a statement explaining the reason for the partial exclusion (job change, health, or unforeseen circumstance). The IRS does not require advance approval — you simply claim the partial exclusion on your return.

> **Record-keeping tip:** Maintain a running file with your home purchase documents, closing statements (HUD-1 or Closing Disclosure), receipts for capital improvements, and records of any depreciation claimed. This documentation is essential if the IRS questions your exclusion.

## 2026 Tax Rates on Non-Excluded Home Sale Gains

If your gain exceeds the Section 121 exclusion, the excess is taxed as a long-term capital gain (assuming you held the home for more than one year, which is virtually always the case for primary residences). Here are the 2026 long-term capital gains rates:

*2026 Long-Term Capital Gains Tax Rates*

| Rate | Single | Married Filing Jointly |
| --- | --- | --- |
| **0%** | Up to $49,450 | Up to $98,900 |
| **15%** | $49,451 - $545,500 | $98,901 - $613,700 |
| **20%** | Over $545,500 | Over $613,700 |

**Net Investment Income Tax (NIIT):** An additional 3.8% surtax applies to net investment income (including capital gains) for single filers with modified AGI above $200,000 or married filers above $250,000. This can push the effective top rate on home sale gains to **23.8%** (20% + 3.8%).

For a complete breakdown of all capital gains brackets and rates, see our [2026 Capital Gains Tax Brackets](https://www.digitalcalculator.info/capital-gains-calculator/2026-tax-brackets/) guide.

[Find Your Capital Gains Tax Rate →](https://www.digitalcalculator.info/capital-gains-calculator/)

## Strategies to Minimize Capital Gains Tax on a Home Sale

Even if your gain exceeds the exclusion, several strategies can reduce your tax bill:

### 1\. Maximize Your Adjusted Basis

Document every capital improvement you have made to the home. Common improvements that increase your basis include:

-   Kitchen and bathroom renovations
-   Room additions or finishing a basement
-   New roof, siding, or windows
-   HVAC system replacement
-   Landscaping (permanent improvements like retaining walls, not routine lawn care)
-   Accessibility modifications (wheelchair ramps, widened doorways)

### 2\. Time Your Sale Strategically

If you are close to the 2-year mark, waiting a few months to sell can qualify you for the full exclusion instead of a partial one. Similarly, timing the sale to a tax year where your income is lower can push non-excluded gains into the 0% long-term capital gains bracket.

### 3\. Consider Installment Sales

If you sell directly to the buyer (not through a traditional mortgage), an installment sale (IRS Form 6252) spreads the gain recognition over multiple tax years. This can keep you in lower tax brackets each year.

### 4\. Offset with Capital Losses

Non-excluded gain from a home sale can be offset by capital losses from other investments. If you have losing stock positions, selling them in the same year as the home sale can reduce your net capital gains. For more on this approach, see our [Tax-Loss Harvesting Guide](https://www.digitalcalculator.info/capital-gains-calculator/tax-loss-harvesting/).

### 5\. Use the Full Married Exclusion

If you are selling before marriage, consider whether waiting until after the wedding and filing jointly could double your exclusion from $250,000 to $500,000. Both spouses must meet the use test, and at least one must meet the ownership test.

For more capital gains tax reduction strategies beyond home sales, see our [Capital Gains Tax Strategies 2026](https://www.digitalcalculator.info/capital-gains-calculator/tax-strategies/) guide.

## How We Calculate These Figures

The gain figures above start from your sale price minus selling costs and your adjusted cost basis (purchase price plus qualifying improvements, minus any depreciation claimed), which produces your total gain. The Section 121 exclusion is then subtracted for the filing-status amount you qualify for based on the ownership and use tests, and any unrecaptured Section 1250 depreciation is carved out and taxed separately before the remaining gain is taxed at the applicable short- or long-term capital gains rate.

## Frequently Asked Questions

### How much capital gains tax do you pay when selling a house?

Most homeowners pay zero capital gains tax on a home sale thanks to the Section 121 exclusion. Single filers can exclude up to $250,000 in gain, and married couples filing jointly can exclude up to $500,000, as long as the home was their primary residence for at least 2 of the last 5 years. Any gain above the exclusion is taxed at long-term capital gains rates of 0%, 15%, or 20% depending on income, plus a potential 3.8% net investment income tax for high earners.

### What is the 2-out-of-5-year rule for home sales?

The 2-out-of-5-year rule requires that you owned and used the home as your primary residence for at least 24 months (which do not need to be consecutive) during the 5-year period ending on the date of sale. You must meet both the ownership test and the use test. For example, if you bought a home on January 1, 2022, and lived in it continuously, you could sell it on or after January 1, 2024, and qualify for the full exclusion.

### Can you exclude capital gains on a second home or vacation property?

No. The Section 121 exclusion applies only to your primary residence — the home where you live most of the time. Gains on second homes, vacation properties, and investment properties are fully taxable. However, if you convert a second home to your primary residence and live in it for at least 2 of the 5 years before selling, you may qualify for the exclusion on a portion of the gain. Gain attributable to periods of non-qualifying use after 2008 is generally not excludable.

### Do you have to report the sale of your home to the IRS?

If your gain is fully excluded under Section 121 and you receive a Form 1099-S from the closing agent, you should still report the sale on your tax return to document the exclusion. If your gain exceeds the exclusion amount, you must report it on Schedule D (Form 1040) and Form 8949. Even if no 1099-S is issued and the full gain is excluded, the IRS recommends keeping records of the purchase price, improvements, and sale price for at least 3 years.

### What is depreciation recapture on a home sale?

If you claimed depreciation deductions on part of your home — typically a home office or rental portion — the Section 121 exclusion does not apply to the depreciation amount. That portion is subject to depreciation recapture under Section 1250, taxed at a maximum federal rate of 25%. For example, if you claimed $20,000 in home office depreciation, you owe recapture tax on that $20,000 even if your total gain is within the exclusion limit.

### Can you use the home sale exclusion more than once?

Yes, but not more frequently than once every two years. The IRS requires that you have not excluded gain from the sale of another home during the 2-year period ending on the date of the current sale. There is no lifetime limit on the number of times you can claim the exclusion — you can use it on every primary residence you sell, as long as you meet the ownership, use, and timing tests each time.

### What qualifies for a partial home sale exclusion?

If you sell your home before meeting the full 2-year ownership or use test, you may qualify for a partial exclusion if the sale was due to a change in place of employment, health reasons, or unforeseen circumstances (such as divorce, death, job loss, or natural disaster). The partial exclusion is calculated proportionally: if you lived in the home for 12 months out of the required 24, you can exclude up to 50% of the maximum exclusion — $125,000 for single filers or $250,000 for married filing jointly.

### How do you calculate capital gains on a home sale?

Capital gain on a home sale equals the sale price minus selling expenses (commissions, closing costs) minus your adjusted basis. Your adjusted basis is the original purchase price plus buying costs (title insurance, transfer taxes) plus capital improvements (additions, renovations) minus any depreciation claimed. For example, if you bought for $300,000, spent $50,000 on improvements, and sold for $550,000 with $33,000 in selling costs, your gain is $550,000 minus $33,000 minus $350,000 = $167,000.

> ### Estimate Your Home Sale Tax
> 
> Enter your home sale price, purchase price, improvements, and filing status to see how much capital gains tax you may owe — or confirm that your gain is fully excluded under Section 121. [Calculate Your 2026 Capital Gains Tax →](https://www.digitalcalculator.info/capital-gains-calculator/)

## Sources

-   [IRS Publication 523 — Selling Your Home](https://www.irs.gov/publications/p523)
-   [IRC Section 121 — Exclusion of Gain from Sale of Principal Residence](https://www.law.cornell.edu/uscode/text/26/121)
-   [IRS Topic No. 701 — Sale of Your Home](https://www.irs.gov/taxtopics/tc701)
-   [IRS Topic No. 409 — Capital Gains and Losses](https://www.irs.gov/taxtopics/tc409)
-   [IRS Schedule D (Form 1040) — Capital Gains and Losses](https://www.irs.gov/forms-pubs/about-schedule-d-form-1040)
-   [IRS Form 8949 — Sales and Other Dispositions of Capital Assets](https://www.irs.gov/forms-pubs/about-form-8949)
-   [National Association of Realtors — Existing Home Sales Statistics](https://www.nar.realtor/research-and-statistics/housing-statistics/existing-home-sales)

### Important Disclaimer

**Disclaimer:** This content is for educational and informational purposes only and does not constitute financial, tax, or legal advice. The Section 121 exclusion involves specific eligibility requirements, and individual circumstances vary significantly. You should consult with a qualified tax professional or CPA before making decisions about your home sale. While we strive for accuracy, tax laws and regulations change frequently. The examples provided are for educational illustration and may not reflect your specific situation. Data current as of August 2026.

Content reviewed by [Mark at Markco Labs](https://www.digitalcalculator.info/about/#builder-heading). [Learn more about our accuracy standards](https://www.digitalcalculator.info/about/#quality-heading).

---

*Read the full article with interactive examples at [digitalcalculator.info](https://www.digitalcalculator.info/capital-gains-calculator/home-sale-exclusion/).*
