LIVE
🏠 Property Details
Gross selling price before costs Enter the sale price.
Agent commissions, closing costs, transfer taxes Enter selling costs (0 if none).
What you originally paid for the home Enter original purchase price.
Additions, remodels, new roof — NOT routine repairs Enter improvements (0 if none).
Total depreciation claimed during any rental period Enter depreciation (0 if none).
📅 Eligibility: 2-of-5 Year Tests
Months you owned the home in prior 60 months Enter months owned (0 to 60).
Months you lived there as main home in prior 60 months Enter months used (0 to 60).
Allows partial exclusion even if under 24 months
📊 Tax Settings
Capital Gains Tax Owed
--
⚠️ Disclaimer: Estimates based on IRC §121 and IRS Publication 523. Nonqualified use rules for prior rental periods are not fully modeled here. Depreciation recapture (unrecaptured Section 1250 gain, max 25%) is shown as a separate item. Consult a tax professional for home sales involving rental conversion, divorce, military service, or other special circumstances.

Sources & Methodology

All formulas verified against IRC §121 (26 USC 121), IRS Publication 523 (Selling Your Home), IRS Topic No. 701, and Treasury Regulation §1.121-1.
📘
IRS Topic No. 701 — Sale of Your Home
Official IRS summary of the $250K/$500K exclusion, 2-of-5 year ownership and use tests, frequency limitation (once every 2 years), and Form 1099-S reporting requirements.
📙
IRS Publication 523 — Selling Your Home
Comprehensive guidance covering adjusted basis calculation, partial exclusion for hardship sales, depreciation recapture rules, nonqualified use period calculations, and special rules for military and divorcing taxpayers.
📊
26 USC §121 — Exclusion of Gain from Sale of Principal Residence
The statutory text of Section 121, confirming the $250K/$500K amounts, 2-of-5 year residence requirement, partial exclusion rules, and nonqualified use provisions for post-2008 rental periods.
Adjusted Basis = Purchase Price + Improvements − Depreciation Amount Realized = Sale Price − Selling Costs Realized Gain = Amount Realized − Adjusted Basis Partial Exclusion = Full Exclusion × (min(ownership, use) / 24) Taxable Gain = max(0, Realized Gain − Depreciation Recapture − Exclusion)
Depreciation recapture is taxed separately at a maximum rate of 25% (unrecaptured Section 1250 gain) and cannot be excluded under Section 121.

Last reviewed: April 2026

Home Sale Capital Gains Exclusion Guide — Section 121 Rules, Partial Exclusion & Depreciation Recapture

Selling your primary residence is one of the most tax-advantaged transactions in the US tax code. Under IRC Section 121, a single homeowner can exclude up to $250,000 of capital gain tax-free. Married couples filing jointly can exclude up to $500,000. For someone in the 20% capital gains bracket, the $500,000 exclusion is worth $100,000 in avoided taxes — but only if you meet the eligibility requirements. Missing the 2-year threshold by even one month, or misunderstanding the depreciation recapture rules, can turn an expected zero-tax sale into a significant tax bill.

The 2-of-5 Year Rule: Both Tests Must Be Met Independently

The most common misunderstanding about Section 121 is thinking you only need to live in the home for 2 years. You actually need to pass two independent tests, each requiring 24 months within the 5-year window ending on your sale date. The ownership test (you owned the home) and the use test (you lived there as your primary residence) must both be met separately. They don’t need to overlap, but each must total at least 24 months.

Ownership Test: months owned in last 60 months ≥ 24 Use Test: months as primary residence in last 60 months ≥ 24
Both must be met within the same 5-year window, but the periods do not need to overlap.
For married couples claiming $500,000: at least one spouse must pass the ownership test, AND both spouses must independently pass the use test.
Example: You bought the home in 2018, rented it out for 3 years, then moved in as your primary residence in 2021. By April 2026 you’ve owned it for 96 months (well over 24) and lived there for 60 months (well over 24). Both tests pass — full exclusion applies.

Partial Exclusion: What Happens When You Sell Before 2 Years

You don’t lose the exclusion entirely if you sell before meeting the 2-year requirement — as long as you have a qualifying reason. The three qualifying reasons are: a job change that moves your new workplace at least 50 miles further from the home, a health condition requiring you to move for treatment or care, or an unforeseen circumstance (divorce, natural disaster, death of a co-owner, multiple births from a single pregnancy, or loss of employment qualifying for unemployment compensation).

The partial exclusion formula is: Partial Exclusion = Full Exclusion × (Qualifying Months / 24). A single filer who qualifies for 18 months gets 18/24 = 75% of $250,000 = $187,500 excluded. If the actual gain is less than the partial exclusion, no tax is owed regardless.

Depreciation Recapture: The Rule Most Sellers Miss

This is where sellers who converted a rental to a primary residence get surprised. Any depreciation you claimed while the property was used as a rental or for business cannot be excluded under Section 121. It’s subject to unrecaptured Section 1250 gain, taxed at a maximum rate of 25% — a higher rate than long-term capital gains for most taxpayers. And it applies regardless of how much of the rest of your gain is excluded.

⚠️ Example: You converted a rental to your primary residence in 2021, claimed $40,000 in depreciation while renting, and now sell with a $280,000 total gain. You qualify for the full $250,000 exclusion. But the $40,000 in depreciation recapture is excluded from your Section 121 benefit — it’s taxed at up to 25% ($10,000 tax), on top of the $30,000 in non-excluded gain taxed at your capital gains rate. Always factor recapture into your pre-sale tax planning.

Capital Gains Tax Rates on the Taxable Portion (2026)

Filing Status0% Rate15% Rate20% RateNIIT Threshold
SingleUp to $47,025$47,026 to $518,900Over $518,900MAGI > $200,000
MFJUp to $94,050$94,051 to $583,750Over $583,750MAGI > $250,000
NIIT Rate+3.8% if MAGI exceeds threshold (makes max effective rate 23.8%)
💡 Timing strategy: If you’re close to the 2-year threshold, it may be worth waiting. A seller with a $300,000 gain who is single and 6 months short of the 2-year mark faces $300,000 × 15% = $45,000 in capital gains tax. Waiting 6 more months to qualify for the full $250,000 exclusion reduces that to $50,000 × 15% = $7,500 — a difference of $37,500 for just 6 months of patience.
Frequently Asked Questions
Under IRC Section 121, single filers can exclude up to $250,000 of capital gain and married couples filing jointly can exclude up to $500,000. You must have owned AND lived in the home as your primary residence for at least 24 months in the 5-year period before the sale. The exclusion applies to profit (capital gain), not the sale price itself. A $600,000 sale on a home you paid $200,000 for means a $400,000 gain — not $600,000.
Both the ownership test and the use test must be met during the 5 years before your sale date. Ownership: you owned the home for at least 24 months. Use: you lived there as your principal residence for at least 24 months. The 24 months do not need to be consecutive — breaks for work abroad, medical care, or temporary relocation still count as long as you intended to return. Both tests must total 24 months independently within the same 5-year window.
Yes, with a qualifying reason. If you sell before meeting 2 years due to a job change (new workplace 50+ miles further), health condition, or unforeseen circumstances (divorce, disaster, multiple birth, death of a co-owner), you can claim: Partial Exclusion = Full Exclusion × (Qualifying Months / 24). Example: single filer qualifying for 15 months: $250,000 × (15/24) = $156,250 partial exclusion.
Adjusted Basis = Original purchase price + Capital improvements − Depreciation claimed. Capital improvements include room additions, major renovations, new roof, HVAC replacement, and solar panels. Routine maintenance (painting, fixing leaks, replacing appliances) does not increase basis. Any depreciation claimed during rental periods reduces your basis dollar for dollar and must be recaptured at sale.
If you claimed depreciation during a rental period, that amount is excluded from the Section 121 benefit and taxed separately as unrecaptured Section 1250 gain at a maximum rate of 25%. This cannot be excluded regardless of how much of your other gain is excluded. Example: $40,000 depreciation claimed while renting = $40,000 taxed at up to 25% ($10,000 tax) even if the rest of your gain is fully excluded.
For the full $500,000 exclusion: at least one spouse must meet the ownership test, but BOTH spouses must independently meet the 2-year use test. If only one spouse qualifies for the use test, you are limited to that spouse’s individual $250,000 exclusion. Additionally, neither spouse can have claimed the exclusion on a different home within the prior 2 years.
Once every 2 years. You cannot claim the exclusion if you used it on another home sale in the 2-year period ending on your current sale date. If you sell a vacation property or rental before meeting the 2-year gap requirement, no exclusion applies to that sale. Some sellers deliberately time sales 2 years apart specifically to maximize use of the exclusion on each sale.
You must report if: you receive Form 1099-S from the title company; you have a taxable gain after exclusion; or there is depreciation recapture. If your gain is fully excluded AND you did not receive Form 1099-S, you generally do not need to report. When in doubt, report using Form 8949 and Schedule D — you can show the excluded amount, resulting in $0 tax owed, with no penalty for over-reporting.
Selling costs that reduce Amount Realized: real estate agent commissions (typically 5–6%), title insurance, attorney fees, transfer taxes, recording fees, and closing costs paid by the seller. Repair costs incurred specifically to sell the home may also qualify. These reduce Amount Realized, which directly reduces your taxable gain. On a $650,000 sale with $25,000 in selling costs, Amount Realized is $625,000 — not $650,000.
Improvements that add value, prolong life, or adapt the home to new uses qualify: room additions, kitchen or bath remodels, new roof, HVAC replacement, deck or pool addition, new windows, basement finishing, solar panels. Routine maintenance does not qualify: painting, fixing a leaky faucet, replacing broken appliances. The higher your basis, the lower your taxable gain — so keeping records of every capital improvement made during your ownership matters.
For property held over 1 year: 0% if taxable income is below $47,025 (single) or $94,050 (MFJ); 15% for most taxpayers; 20% for high earners. Add 3.8% NIIT if MAGI exceeds $200,000 (single) or $250,000 (MFJ), making the effective top rate 23.8%. Depreciation recapture is taxed at up to 25% as unrecaptured Section 1250 gain. Short-term gains (held 1 year or less) are taxed at ordinary income rates (10%–37%).
Yes, but with important limitations. You can claim Section 121 exclusion on a converted rental if you meet the 2-of-5 year tests. However, gain allocated to “nonqualified use” periods (rental use after 2008) is not excludable. Additionally, all depreciation claimed during rental periods must be recaptured and cannot be excluded. A property rented for 3 years then used as a primary residence for 2 years will have roughly 60% of its gain potentially excludable, but the exact calculation depends on the specific timeline and depreciation amounts.
Related Finance Calculators
Popular Calculators
🧮

Missing a Finance Calculator?

Can’t find the financial tool you need? Tell us — we build new ones every week.