IBRAVRA Media Network
Taxes • 12 min read

Section 121 Primary Residence Exclusion Playbook: Keep $250,000 — or $500,000 — of Your Home-Sale Gain

Own and live in your home 2 of the last 5 years and exclude up to $250,000 of gain — $500,000 joint. The worked math, the partial exclusion, and the two traps that take a cut first.

By Enow A. Jovial • Published 2026-11-08

Section 121 Primary Residence Exclusion Playbook: Keep $250,000 — or $500,000 — of Your Home-Sale Gain

A single filer who bought a house for $420,000, added $30,000 of improvements, and sold it in 2026 for $780,000 owes tax on $60,000 of a $310,000 gain. Section 121 of the Internal Revenue Code is the only provision that lets a homeowner erase gain permanently, with no replacement property and no fund. The price is one test: own and use the home as your principal residence for periods adding up to 2 years inside the 5 years ending on the sale date.

Own and live in your home for 2 years out of the 5 before the sale and exclude up to $250,000 of gain — $500,000 on a joint return. Miss the test and a partial exclusion may still cover part of the gain. Rent the home after 2008 or claim depreciation, and nonqualified use and recapture take a cut.

The statute: one test, two dollar caps

Section 121(a) states the rule in full: "Gross income shall not include gain from the sale or exchange of property if, during the 5-year period ending on the date of the sale or exchange, such property has been owned and used by the taxpayer as the taxpayer's principal residence for periods aggregating 2 years or more." The 2 years need not be continuous.

Section 121(b)(1) caps the exclusion at $250,000 per sale. Section 121(b)(2) raises the cap to $500,000 on a joint return when either spouse meets the ownership test, both meet the use test, and neither is barred by the once-every-2-years rule. If only one spouse meets the use test, each spouse gets the exclusion that spouse qualifies for, and the two amounts are added. A surviving spouse keeps the $500,000 cap on a sale within 2 years of the death, under section 121(b)(4). The caps are fixed figures Congress has never indexed, and a gain above the cap is taxed as capital gain.

26 U.S.C. § 121(a) and (b) text
26 U.S.C. § 121(a) and (b) text

The worked sale: $310,000 of gain, $60,000 taxable

Take Maya, who bought in 2019 for $420,000 and added a $30,000 remodel, for a $450,000 adjusted basis. In 2026 she sells for $780,000, pays $20,000 in selling expenses, and her amount realized is $760,000. Her gain is amount realized minus adjusted basis, and the exclusion takes the first $250,000:

Gain: $760,000−$450,000=$310,000;Taxable: $310,000−$250,000=$60,000\text{Gain: } \$760,000 - \$450,000 = \$310,000; \quad \text{Taxable: } \$310,000 - \$250,000 = \$60,000
Tax at 20%: $60,000×20%=$12,000\text{Tax at 20\%: } \$60,000 \times 20\% = \$12,000

The 20 percent rate is the top federal rate on adjusted net capital gain under section 1(h)(1)(D). Maya's total federal tax on a $310,000 gain is $12,000.

The once-every-2-years rule

Section 121(b)(3) bars the exclusion if the taxpayer used it on another sale inside the 2 years ending on the current sale date. The bar is per taxpayer: sell two homes 18 months apart and only the first sale gets the exclusion. Publication 523 calls this the look-back requirement, alongside the ownership and residence tests in the IRS eligibility check.

Partial exclusion: the 12-month job transfer

Section 121(c) covers the taxpayer who fails the ownership test, the use test, or the look-back rule because of a change in employment, health, or unforeseen circumstances. The dollar cap is cut in proportion to the time actually spent. Publication 523, Worksheet 1, states the formula: take the shortest of three periods — residence time, ownership time, and time since the last excluded sale — divide by 24 months, and multiply by $250,000. For a joint return, run it for each spouse and add the results.

Take Daniel, who lived in his home 12 months, then took a job 900 miles away and sold for a $180,000 gain. His reduced exclusion is half the cap:

Reduced exclusion: 1224×$250,000=$125,000;Taxable: $180,000−$125,000=$55,000;Tax at 20%: $11,000\text{Reduced exclusion: } \frac{12}{24} \times \$250,000 = \$125,000; \quad \text{Taxable: } \$180,000 - \$125,000 = \$55,000; \quad \text{Tax at 20\%: } \$11,000

Publication 523 lists work-related moves, health events, death, divorce, a pregnancy with multiple children, a change in employment status, a change in unemployment compensation eligibility, and other events named in IRS published guidance. Outside the listed events, a taxpayer can still qualify on the facts: the situation arose while owning and living in the home and could not reasonably have been anticipated at purchase. A voluntary move to a nicer neighborhood does not qualify; a transfer ordered by an employer does.

A partial exclusion is a fraction measured in months. Twelve months buys half the cap, six months a quarter. Count the months before you sign the listing agreement: one more month can be worth tens of thousands of dollars of exclusion.

Nonqualified use: the rental years after 2008

The Housing Assistance Tax Act of 2008 added section 121(b)(5). Gain allocated to periods of nonqualified use — any period after 2008 when neither the taxpayer nor a spouse used the property as a principal residence — cannot be excluded. The allocation is the ratio of nonqualified-use periods to total ownership, applied after depreciation is removed.

Time after the last qualified use is not nonqualified use, so renting after moving out does not shrink the exclusion. Up to 10 years on qualified official extended duty is excluded. Temporary absences up to 2 years for employment change, health, or unforeseen circumstances are excluded.

Publication 523 works the example. Finley bought January 1, 2020 for $400,000, rented it 2 years claiming $20,000 of depreciation, moved in January 1, 2022, moved out January 1, 2024, and sold January 1, 2025 for $700,000. Total gain is $320,000; after removing depreciation, $300,000 remains, and 2 of the 5 ownership years were nonqualified use:

Nonqualified gain: 25×$300,000=$120,000;Excluded: $300,000−$120,000=$180,000;Tax at 20%: $24,000\text{Nonqualified gain: } \frac{2}{5} \times \$300,000 = \$120,000; \quad \text{Excluded: } \$300,000 - \$120,000 = \$180,000; \quad \text{Tax at 20\%: } \$24,000

The $120,000 is long-term capital gain; the $20,000 of depreciation is recaptured separately. Finley's $250,000 cap was never the binding limit — the unused $70,000 of cap is lost. Contrast Taylor, who lived in the home first, then rented it after moving out: the rental fell after the last qualified use, so no nonqualified use. Order matters: rent first and the rental years cost you; live first and they do not.

Depreciation recapture: the part the exclusion cannot touch

Section 121(d)(6) is absolute: the exclusion "shall not apply to so much of the gain from the sale of any property as does not exceed" the depreciation adjustments attributable to periods after May 6, 1997. Depreciation claimed while the home was rented or used for business comes back as unrecaptured section 1250 gain, taxed at most 25 percent under section 1(h)(1)(E).

Taylor bought January 1, 2020 for $400,000, lived in the home, moved out January 1, 2023, rented it, claimed $27,000 of depreciation, and sold December 1, 2024 for $600,000. Gain is $227,000: $600,000 minus a $373,000 adjusted basis. After subtracting the depreciation, $200,000 remains and is fully excludable, since the rental fell after the last qualified use. The $27,000 is reported on Form 4797 as unrecaptured section 1250 gain.

On a joint return the two rules stack. A couple bought in 2018 for $500,000, added $40,000 of improvements, claimed $36,000 of depreciation, and sold in 2026 for $950,000 with $25,000 of selling expenses. Amount realized is $925,000; adjusted basis is $504,000; gain is $421,000. The $36,000 slice is taxed at 25 percent, and the remaining $385,000 is excludable under the $500,000 joint cap:

Gain: $925,000−$504,000=$421,000;Recapture tax: $36,000×25%=$9,000;Excludable: $385,000≤$500,000\text{Gain: } \$925,000 - \$504,000 = \$421,000; \quad \text{Recapture tax: } \$36,000 \times 25\% = \$9,000; \quad \text{Excludable: } \$385,000 \leq \$500,000

Total federal tax on a $421,000 gain: $9,000 — the recapture is the only tax. A home-office room inside the living area works differently: Publication 523's Logan, a lawyer who used one room as an office, claimed $2,000 of depreciation and sold with a $13,000 gain, recognized the $2,000 as unrecaptured section 1250 gain and excluded the remaining $11,000, with no allocation to the office.

Section 121 vs section 1031 vs the opportunity zone fund

Section 121 excludes gain permanently, capped at $250,000 or $500,000, and the seller keeps the cash. Section 1031 defers gain on real property held for productive use or investment, with no dollar cap, but the gain survives in the replacement property's lower basis and the exchange must close within 180 days of identifying replacement property within 45 days. A qualified opportunity zone fund defers a capital gain until December 31, 2026, then excludes only appreciation inside the fund after a ten-year hold. Our section 1031 exchange playbook prices the exchange clocks, and our qualified opportunity zone fund playbook prices the 51-day deferral left in 2026 and the ten-year exclusion.

Outcome§ 121§ 1031QOFAuthority
Gain on the saleExcluded to $250,000 / $500,000Deferred; basis carries overDeferred to Dec 31, 2026; later gains excluded after 10 years§ 121(b)(1)-(2); § 1031(a); § 1400Z-2(b), (c)
Cash after the saleFree to spendMust be reinvested in like-kind propertyInvest in fund within 180 days§ 121(a); § 1031(a)(3); § 1400Z-2(a)(1)
Property that qualifiesPrincipal residence onlyBusiness or investment real propertyAny capital gain§ 121(a); § 1031(a)(1); § 1400Z-2(a)(1)
Clock that controls2 years of use in 5 years45 days to identify, 180 to close180 days to invest, 10 years to exclude§ 121(a); § 1031(a)(3); § 1400Z-2(a)(1), (c)
After a 1031 exchangeBarred 5 years from the exchangeGain stays deferredFund rules apply separately§ 121(d)(10); § 1031(a); § 1400Z-2
Rental historyNonqualified use after 2008 cuts itRental use qualifiesRental history is irrelevant§ 121(b)(5); § 1031(a)(1); § 1400Z-2(a)(1)
IRS Publication 523 eligibility and partial exclusion worksheets
IRS Publication 523 eligibility and partial exclusion worksheets

Special rules worth knowing before you sell

Personnel on qualified official extended duty may suspend the 5-year test up to 10 years, under section 121(d)(9). A taxpayer who becomes incapable of self-care needs only 1 year of residence, and time in a care facility counts, under section 121(d)(7). Divorce does not break the test: a spouse whose former spouse lives in the home under a divorce or separation instrument is treated as using it, under section 121(d)(3)(B). An involuntary conversion is treated as a sale, under section 121(d)(5), and a remainder interest can qualify on election, under section 121(d)(8).

The exclusion covers gain, not loss, and it is federal — states set their own treatment.

Filing: where the numbers land

If the full gain is excludable and no Form 1099-S was received, the sale need not be reported. If a 1099-S was received, or any part of the gain is taxable, report on Schedule D and Form 8949. The 1099-S carries your SSN or ITIN. Recapture goes on Form 4797; your CPA should check the figure first. Rental income and expenses from the years the home was let belong on Schedule E — our Schedule E rental income playbook covers it.

Founder & CEO Insight — Enow A. Jovial

"The exclusion is the only part of the tax code that pays you for living in your own house. A 1031 exchange defers the tax and a fund defers it longer, but section 121 deletes it — up to half a million dollars, cash in hand, no replacement property, no ten-year hold. The test is two years of living there. Meet it, and the gain is gone."
— Enow A. Jovial, Founder & Chief Executive Officer

Who should not count on the exclusion

A house bought as a flip or never lived in for 2 years fails the use test, and no partial exclusion saves a sale made for a reason outside work, health, or unforeseen circumstances. A rental converted to a residence inside the last five years carries nonqualified use no later residence erases. A property acquired in a 1031 exchange inside the last five years is barred by section 121(d)(10). Anyone whose gain sits mostly in depreciation recapture should run the numbers first: the exclusion cannot shelter the recapture slice. Run the ROI calculator at your own rate — the 20 and 25 percent figures here are the top federal rates.

Before listing, count residence months: 24 months inside the window, no other excluded sale inside the last 2 years, and no 1031 acquisition inside the last 5 years. Three dates decide the exclusion — purchase, move-in, and the last excluded sale. Ask your CPA to confirm the Worksheet 3 allocation if the home was ever rented.

Execution checklist: sell the home in one pass

  1. Step 1 — Count the test. Own and use the home as a principal residence for 24 months inside the 5 years ending on the sale date; no other excluded sale in the last 2 years.
  2. Step 2 — Price the cap. $250,000 single, $500,000 joint if both spouses meet the use test; surviving spouse keeps $500,000 for 2 years.
  3. Step 3 — Check the traps. Nonqualified use after 2008, depreciation after May 6, 1997, and a 1031 acquisition inside the last 5 years each take their cut first.
  4. Step 4 — Compute the gain. Amount realized minus adjusted basis; run Publication 523 Worksheet 2.
  5. Step 5 — Apply the exclusion. Full, partial by months, or allocated under Worksheet 3 — in that order.
  6. Step 6 — File what remains. Schedule D and Form 8949 for any taxable gain, Form 4797 for recapture.
  • [x] Test met: 24 months of ownership and use inside the 5-year window.
  • [x] Cap priced: $250,000 single or $500,000 joint.
  • [x] Traps checked: nonqualified use, depreciation recapture, 1031 five-year bar.
  • [x] Gain computed: amount realized minus adjusted basis, Worksheet 2.
  • [x] Exclusion applied: full, partial, or allocated.
  • [x] Return filed: Schedule D and Form 8949, Form 4797 for any recapture.

Two years of residence, one sale every two years, and the gain up to the cap is gone for good — the simplest large tax saving most homeowners will ever claim, most often lost by selling a few months too soon.