Primary Residence Capital Gains Exclusion
The primary residence capital gains exclusion under Section 121 of the tax code allows individual homeowners to exclude up to $250,000 in gains from the sale of their home, or $500,000 if filing jointly. The home must have been owned and lived in for at least two of the five years before the sale.
The $250,000 and $500,000 Thresholds
Under Section 121, a homeowner can exclude capital gains on the sale of a primary residence. Single filers exclude up to $250,000; married couples filing jointly exclude up to $500,000. This exclusion is one of the largest tax benefits in the code.
The exclusion applies only to gains. If the home sells for less than the basis (adjusted purchase price plus improvements), there is no gain to exclude — and capital losses on personal residences cannot be deducted. But if the home appreciates significantly, the exclusion covers the bulk of gains for most homeowners.
Example: A single homeowner bought a house for $300,000 and sells it 10 years later for $500,000. The gain is $200,000. The entire gain is excluded under Section 121; no federal income tax is owed on the sale.
A married couple in the same situation (basis $300,000, sale price $550,000, gain $250,000) also owes no federal tax; the entire gain is covered by their $500,000 exclusion.
If the gain exceeds the threshold, the excess is taxed as a long-term capital gain at preferential rates (0%, 15%, or 20%, depending on income).
The Two-of-Five-Year Ownership and Use Tests
To claim the Section 121 exclusion, the homeowner must meet both an ownership test and a use test over the five-year period before the sale:
- Ownership test: The homeowner must have owned the home for at least two of the last five years before the sale.
- Use test: The homeowner must have lived in the home as a primary residence for at least two of the last five years.
These tests do not need to be continuous. The homeowner can own the property for years 1–2 and 4–5 (skipping year 3), and still satisfy the ownership test. Similarly, the primary-residence use does not need to be during the same periods as ownership, though practically they often overlap.
Example: A homeowner buys a house, lives in it for two years, moves out, rents it for two years, then sells. The ownership test is satisfied (five years total). The use test is satisfied (two years as primary residence). The full exclusion applies.
The two-year windows must fall within the five-year lookback period. If someone buys a house today and sells it tomorrow, the tests are not met. Typically, the two years are contiguous, but they do not have to be.
The Once-Every-24-Months Rule
The Section 121 exclusion is available once every 24 months per homeowner. If someone used the exclusion on a home sale two years ago, they can use it again on a new primary residence today.
This rule prevents overuse. A homeowner cannot claim the exclusion on multiple properties in the same year or in overlapping years; the previous use must have been at least 24 months earlier.
Example: In 2020, a homeowner sells a house and claims the $250,000 exclusion. In 2021, the homeowner buys a new house and sells it for a gain. The Section 121 exclusion is not available yet; it will be available in 2022 (24 months after the 2020 sale).
The 24-month period is measured from the last sale on which the exclusion was claimed, not from the purchase date of the new home.
Married Couples: Special Rules and the $500,000 Threshold
For married couples filing jointly, the exclusion doubles to $500,000. Both spouses must meet the ownership and use tests — they do not each get a separate $250,000 exclusion that combines to $500,000; rather, the couple gets one combined $500,000 exclusion.
If both spouses meet the tests independently (for example, because they each owned the home before marriage), they can still claim the full $500,000 as a couple.
If only one spouse meets the tests, the couple can claim $250,000 (the single-filer amount), not $500,000.
Example: A couple owns a house together and both lived in it for the required two years. They sell for a gain of $450,000. The entire gain is excluded under the $500,000 threshold. No federal tax is owed.
If the same couple had bought the house with only one spouse on the deed, but the other spouse also lived in it as a primary residence, they likely still qualify for the full $500,000 if both meet the use test.
Partial Exclusion: The Reduced Circumstances
The full exclusion is available if the owner meets the ownership and use tests. But the IRS allows a partial exclusion if the owner sells before the two-year tests are met, due to a “sale due to a change in place of employment, health, or unforeseen circumstances.”
The partial exclusion is calculated as a fraction: the length of time the tests are met divided by 24 months, times the otherwise-available exclusion.
Example: A homeowner buys a house and lives in it for 18 months, then must sell due to a job transfer (a qualifying change in employment). The ownership and use tests are not met (only 18 months instead of 24). The partial exclusion is (18 months / 24 months) × $250,000 = $187,500.
Qualifying changes include a job transfer, illness or health condition, death, unforeseen circumstances (such as divorce or loss of a job), or similar events. The IRS has published guidance on what qualifies. Home renovation or the desire to upgrade to a larger house do not qualify.
The reduced exclusion formula applies separately to the principal residence exclusion and any depreciation-recapture exclusion if the home was used partially for business.
Primary Residence Definition
The home must be the owner’s primary residence, not a second home or investment property. The IRS determines this based on where the owner spent the most time and maintained the most significant personal ties (voting address, mailing address, driver’s license, etc.).
If someone owns multiple homes, only one can be the primary residence at any time. A vacation home or rental property does not qualify, even if the owner occasionally lives there.
If someone converts a primary residence to a rental property (or vice versa), only the time it was used as a primary residence counts toward the use test.
Example: A homeowner lived in a house for five years as a primary residence, then converted it to a rental for two years, then sold. The use test is met (five years out of the last five, counting only the years as primary residence). If instead the homeowner rented it for the last two years before sale, the use test is still met (five years primary residence within the last seven-year window, which is more than the required two of five).
Exclusion Does Not Apply to Investment Properties or Rental Homes
The Section 121 exclusion applies only to primary residences. If a home is rented out or used as a second home, the exclusion is not available. Instead, any gains are subject to capital gains tax, and depreciation recapture applies.
Example: Someone buys a house for $200,000, uses it as a rental for five years (claiming $30,000 in depreciation deductions), then sells it for $400,000. The gain is $200,000 (sale price $400,000 minus basis $200,000). None of this gain is excluded under Section 121 because the home was not a primary residence. The gain is taxed as a long-term capital gain, and $30,000 of it is subject to depreciation recapture (taxed at 25% federal rate).
If the same person had lived in the house for two of the five years before sale, the Section 121 exclusion might be partially available based on the proportion of time it was a primary residence.
Depreciation Recapture Does Not Apply
If the home was used only as a primary residence (never rented or used for business), no depreciation recapture applies, even though the gain is being calculated using the adjusted basis.
If the home was depreciated while used for business or rental (perhaps the owner claimed home office deductions), the depreciation is recaptured at 25% federal rate on the portion of the home attributable to the business use.
Example: A homeowner lived in a house and claimed $5,000 in home office depreciation deductions. Upon sale, the gain is $200,000. The exclusion covers $250,000 (assuming single filer), so no gain is taxable. The depreciation recapture is also avoided because the gain is fully excluded.
But if the gain were $350,000 (exceeding the $250,000 single-filer exclusion), $100,000 of gain is taxable. Of that, any amount attributable to depreciation recapture is taxed at 25%, and the remainder is taxed at the long-term capital gains rate (15% or 20%).
Wash-Sale and Like-Kind Exchange Rules Do Not Apply
The Section 121 exclusion is not subject to the wash-sale rules (which prevent realizing losses and repurchasing substantially identical property) or the like-kind exchange rules (which allowed deferral of gains through 1031 exchanges for property trades).
A homeowner can sell a primary residence, claim the exclusion, and immediately buy another home without any coordination or deferral requirement.
See also
Closely related
- Capital Gains Tax (Investor) — The broader framework for capital gains taxation
- Long-Term Capital Gains Tax — Tax rates applied to gains exceeding the primary residence exclusion
- Cost Basis — How the purchase price and improvements determine the adjusted basis for sale calculations
- Depreciation Recapture (Investor) — How prior depreciation deductions are recaptured on sale
Wider context
- Residential Real Estate — Broader context on home ownership and taxation
- Capital Gains Tax on Inherited Property — How the step-up in basis applies to inherited homes
- Real Estate Investment Trust — How REITs differ from direct property ownership for tax purposes