Why It Matters
You qualify by passing two tests under the 2-of-5-year rule: you owned the home for at least two of the last five years, and you used it as your primary residence for at least two of those same five years. The periods don't need to overlap or run consecutively — they just need to add up to 24 months within that five-year window. You can only use the exclusion once every two years. For investors who house hack, this is the single biggest tax benefit in the code — but the rental portion doesn't qualify, and depreciation you took while renting is always recaptured at 25% regardless of §121.
At a Glance
- What it is: IRC §121 tax exclusion — up to $250K (single) or $500K (married filing jointly) of home sale gain excluded from federal income tax
- The two tests: Ownership test (owned 2 of 5 years) AND use test (lived there 2 of 5 years) — both required
- Frequency limit: One exclusion every two years per taxpayer
- Depreciation trap: §121 does NOT shield depreciation recapture — that 25% tax bill survives no matter what
- Investor use: House hackers and BRRRR investors who convert rentals to primary residences use this to shelter large gains at exit
Excluded Gain = Min(Actual Gain, $250,000 single / $500,000 MFJ)
How It Works
The two 2-of-5 tests. §121 requires you to pass both an ownership test and a use test. For ownership, you must have held title for at least 24 months out of the 60 months before the sale. For use, you must have lived in the property as your principal residence for at least 24 months in that same window. These periods don't need to overlap — you could have owned a property from 2018 to 2022, rented it out, moved back in during 2023 and 2024, then sold in 2025 and still qualify on both counts. What matters is that each test totals 24 months within the five-year lookback.
Partial exclusion when tests aren't fully met. If you fall short of the 24-month thresholds due to a qualifying hardship — job relocation, health issue, or an "unforeseen circumstance" like divorce or job loss — you can still claim a pro-rated exclusion. The formula: (Qualifying Months / 24) × $250,000, or × $500,000 if married filing jointly. Someone who moved after 18 months for a new job gets 75% of the full exclusion — $187,500 instead of zero.
The depreciation recapture wall. This is the investor trap that surprises people every time: §121 does not protect depreciation recapture. Every dollar of depreciation you claimed — or were allowed to claim — gets recaptured at a flat 25% rate under §1250. The exclusion shelters your long-term capital gains, but it has no power over recapture. A house hacker who claimed $18,000 in depreciation over three years will owe $4,500 in recapture tax at closing, period. The nonqualified use rule adds a second layer: gain attributable to periods after January 1, 2009 when the property was NOT your primary residence is excluded from the exclusion. Calculate that taxable slice as: Gain × (Nonqualified Use Months / Total Ownership Months).
Real-World Example
David bought a duplex in Columbus for $318,000 in 2019. He lived in one unit and rented the other, claiming $4,100 per year in depreciation on the rental unit for four years — $16,400 total. In 2023, he moved out entirely and rented both units for a year before selling in 2024 for $503,000. His total gain: $185,000.
Under §121, David meets both the ownership test (5 years) and the use test (4 years living in). But two things reduce his exclusion. First, the rental unit he never occupied doesn't qualify — roughly half the property. Second, that final year as a non-occupant counts as nonqualified use. After the nonqualified-use proration, approximately $37,000 of his gain is taxable at long-term capital gains rates. Plus the $16,400 in depreciation gets recaptured at 25% — another $4,100 tax bill. Still, he walks away sheltering over $140,000 of gain completely tax-free. Without §121, he'd owe taxes on the full $185,000.
Pros & Cons
- Shelters up to $500,000 of gain tax-free for married couples — one of the largest exclusions in the tax code
- Works for house hackers who live in a property while building equity, then sell
- The two years don't need to be consecutive — great for investors who rotate in and out
- Partial exclusion still available for hardship situations (job change, health, divorce)
- No income phase-out — available to investors at any income level
- Does not shield depreciation recapture — that 25% bill is always due
- The nonqualified use rule (post-2008) taxes gain from periods you didn't live there
- Rental portions of a property — separate units or square footage — are excluded from the shelter
- Once-every-two-years frequency cap limits tactical use
- MFJ $500K requires both spouses to meet the use test — one absent spouse disqualifies the bump
Watch Out
- Depreciation recapture is unavoidable. Every investor who has claimed depreciation on a converted rental is surprised by this. §121 is powerful, but §1250 recapture at 25% runs independently. Calculate your recapture liability before you price the sale — it changes your net proceeds.
- The 1031-to-primary-residence clock. If you used a 1031 exchange to acquire a property and then move in, the Housing Assistance Tax Act of 2008 requires you to hold the property for five years AND meet the standard two-year use test before §121 applies. The old strategy of quickly converting a 1031 property into a primary residence to trigger the exclusion no longer works.
- Nonqualified use isn't retroactive to pre-2009. Only periods of non-primary use after January 1, 2009 count against you. If you owned a property as a rental from 2005 to 2008 before moving in, those early rental years don't reduce your exclusion — only post-2008 nonqualified use does.
- Co-ownership and partial title. If you own a property with a non-spouse partner and only one owner meets the tests, only that owner can claim their share of the exclusion. Make sure your ownership structure matches who qualifies.
Ask an Investor
The Takeaway
The Primary Residence Exclusion is one of the most powerful tax breaks available to real estate investors — especially house hackers who build equity while living in their investments. Up to $500,000 in gain walks away tax-free. But it's not a clean sweep: depreciation recapture survives no matter what, the nonqualified use rule taxes gain from rental periods, and the 1031 combination strategy carries a five-year lockup. Know the mechanics before you sell, not after — the numbers are too large to optimize at closing.
