Skip to main content
Tax Advantages

The 2 of 5 Year Rule

Pomegra Learn

The 2 of 5 Year Rule

The §121 exclusion has two requirements: you must own the home for at least 2 of the last 5 years, and you must have lived in it as your principal residence for at least 2 of the last 5 years. These rules seem simple but require careful tracking if you've changed residences, moved for work, or rented out part of your home.

Key takeaways

  • Ownership test: own the property for 2+ of the last 5 years (not necessarily consecutive).
  • Use test: live in the property as principal residence for 2+ of the last 5 years (not consecutive).
  • Both tests must be met during the same 5-year window.
  • If you fail either test, you lose the §121 exclusion entirely (or get a partial exclusion if failing due to health, work relocation, or other hardship).
  • Temporary absences (vacation, medical leave) don't break the use test if your intent to return is clear.

The ownership test: the 2-year ownership requirement

You must own the home for at least 2 years of the 5-year period ending on the sale date. The 2 years do not need to be consecutive.

Example 1 (qualify):

  • Buy home: January 2020.
  • Sell home: June 2024.
  • Ownership period: 4.5 years (definitely 2+ years).
  • Result: Ownership test met.

Example 2 (fail):

  • Buy home: January 2023.
  • Sell home: June 2024.
  • Ownership period: 1.5 years.
  • Result: Ownership test not met. No exclusion.

Example 3 (complex):

  • Buy home: January 2020.
  • Sell home (first sale): June 2022 (2.5 years owned).
  • Reclaim exclusion? No, it was used.
  • Buy another home: July 2022.
  • Sell (second home): June 2024 (2 years owned).
  • Ownership test met on second home. Eligible for §121 if use test also met.

The use test: principal residence for 2 of 5 years

You must live in the home as your principal residence for at least 2 of the last 5 years. "Principal residence" is defined as the place where you spend the majority of time, or intend to return to.

The test is not 2 consecutive years. You can live in the home for 1 year, move away for 1 year, then return for 1 year, and still satisfy the 2-of-5 test (total 2 years in 5-year window).

Example 1 (qualify):

  • Year 1: Live in home (principal residence).
  • Year 2: Live in home (principal residence).
  • Year 3: Move away for work, rent a different home.
  • Year 4: Return and live in original home (principal residence).
  • Year 5: Sell home.
  • Use test: 3 years in last 5. Test met.

Example 2 (fail):

  • Year 1: Buy home, live in it (principal residence).
  • Year 2: Buy a vacation home, live there most of year, original home is secondary.
  • Year 3: Vacation home is principal residence.
  • Year 4: Vacation home is principal residence.
  • Year 5: Sell original home.
  • Use test: 1 year as principal residence in the last 5. Test not met.

Example 3 (temporary absence):

  • Live in home for 2 years (principal residence).
  • Year 3: Sabbatical abroad for 1 year (no intention to abandon home).
  • Year 4: Return to home.
  • Sell home in year 5.
  • Use test: Are the 2 years (year 1 + year 4) sufficient? Likely yes, if the abroad year is deemed a temporary absence. However, the IRS looks at intent. If you sold the home abroad or moved your furniture, intent to return is questionable.

Both tests must be satisfied in the same 5-year period

This is a common point of confusion. The 5-year window is determined by the sale date and runs backward 5 years. Both the ownership and use tests must be satisfied within this same window.

Example:

  • Buy home: January 2019.
  • Sell home: June 2024.
  • 5-year window: June 2019 – June 2024.
  • Ownership: January 2019 to June 2024 = 5.5 years. But only the 5-year window counts: June 2019 – June 2024 = 5 years. Test met.
  • Use: Must have lived there 2+ of the June 2019 – June 2024 window. If you lived there 2019–2022 (3 years within window), test met.

If you owned the home from 2012 but only moved in as principal residence in May 2024 (1 month before sale), the 5-year window would be June 2019 – June 2024, and you've lived there less than 2 years in that window. Test fails.

Partial exclusion: the hardship waiver

If you fail the 2-of-5 test due to a hardship or change of circumstances, you may claim a partial exclusion. The IRS recognizes several circumstances:

  • Change of employment or job transfer: If required to move for work.
  • Adverse health condition: Medical emergency requiring relocation.
  • Death of a spouse, co-owner, or family member: Creating need to sell or move.
  • Divorce or legal separation: Dividing property.
  • Multiple contingencies: Circumstances making it impractical to remain in the home.

If you qualify for hardship, the exclusion is calculated as:

  • Actual exclusion = Standard exclusion × (qualifying time in home ÷ 2 years).

Example:

  • You owned and lived in home for 1.5 years as principal residence.
  • Job relocation required you to sell.
  • Partial exclusion = $500,000 × (1.5 ÷ 2) = $375,000.
  • Taxable gain = realized gain – $375,000.

This is significantly better than zero exclusion but less than the full $500,000.

Rented-out home and the principal-residence test

If you convert your principal residence to a rental property, you stop satisfying the use test. The use test requires living in the home as principal residence, not merely owning it.

Example:

  • Live in home as principal residence for 2 years.
  • Convert to rental property (move out) for 1 year.
  • Sell home.
  • Use test: 2 years in last 5. Test met.
  • §121 exclusion: Available, but depreciation recapture applies to the 1-year rental period.

However, if you rent the home out, depreciation deductions taken during the rental period are subject to 25% recapture tax. So you get the §121 benefit but lose part of it to recapture.

Example (quantified):

  • Buy home for $500,000.
  • Live in as principal residence for 2 years.
  • Rent out for 1 year (depreciation: ~$6,000 on 70% basis ÷ 27.5 years).
  • Sell for $750,000.
  • Gain: $250,000.
  • §121 exclusion: $500,000 (gain is under exclusion; no tax).
  • Depreciation recapture: $6,000 × 25% = $1,500 tax owed.
  • Net tax: $1,500.

If you had lived in the home the entire time, tax would be $0. The rental period triggers recapture.

Multiple properties and the frequency limitation

The §121 exclusion can be used once every two years. If you own multiple properties, you can use it on one property, wait two years, then use it on another.

However, only one home can be your principal residence at any given time. The IRS disallows §121 if you claim principal-residence status for multiple homes in the same tax year.

Example:

  • Own home A (principal residence in 2020–2022).
  • Own home B (purchased as investment property, no principal-residence claim).
  • Sell home A in June 2023.
  • Use §121 on home A.
  • Buy home C, move in as principal residence in July 2023.
  • Sell home B in January 2024 (never was principal residence).
  • §121 not available for home B (never principal residence, so §121 doesn't apply).
  • Can you use §121 on home C? Not until June 2025 (2 years after home A sale).

This frequency rule prevents abuse but can trap investors who are actively buying and selling.

Calculation of the 2-of-5 test in practice

The IRS calculates the test based on calendar days, not tax years. If you own a home from June 1, 2019, to June 1, 2024, you've owned it exactly 5 years. Selling it on June 2, 2024, means you owned it 5 years + 1 day, and the entire 5-year look-back window is within your ownership period.

If you sell on May 31, 2024, you owned it 4 years + 364 days—less than 5 years of ownership. In the 5-year look-back window (May 31, 2019 – May 31, 2024), you owned it for 5 years within the window, which is 2+ years. Test met.

The IRS allows a grace period of up to 10 years for temporary absences due to health, military service, or work assignment abroad. These periods don't break the use test.

Planning around the 2-of-5 rule

Investors sometimes plan acquisitions with the 2-of-5 rule in mind:

  1. Buy a property as primary residence.
  2. Live in it for 2 years (establish principal-residence use and meet 2-of-5 test in advance).
  3. Rent it out or move away for up to 3 years (2-of-5 test is still met because 2 years in the 5-year window are satisfied).
  4. Sell the property and claim §121 exclusion.

This strategy allows you to live in a property, then convert it to a rental or secondary home, while still retaining the §121 benefit. It's particularly valuable in high-appreciation markets where you want both the tax benefit and the flexibility to relocate.

Flowchart: 2-of-5 test application

Next

The §121 exclusion is a powerful benefit for primary-residence sellers. For investors who want to defer taxes on real-estate sales indefinitely, the 1031 exchange offers an alternative path. A 1031 exchange allows you to sell one property and buy another like-kind property without triggering capital gains tax, indefinitely deferring the tax until you sell for cash.