Buy a home, live in it for two years, rent it out for three — and when you sell just before the five-year window closes, Section 121 shields every dollar of capital gains, including the appreciation that built up while tenants were paying your mortgage. The only tax you’ll owe is 25% depreciation recapture on whatever you claimed during the rental period.
How the Five-Year Window Works
Section 121 requires that you owned the property and used it as your primary residence for two out of the five years prior to the sale. That’s the key phrase: two out of five. The IRS does not require you to sell when you move out. You can convert the home to a rental for up to three years and still qualify for the full exclusion — up to $250,000 in capital gains for a single filer, $500,000 for a married couple — when you sell before the window expires.
What makes this powerful is what Section 121 covers. The exclusion applies to all capital gains recognized at sale, not just the appreciation from your residency period. The gains that accrued while tenants were living there and the property was climbing in value are sheltered just the same as the gains from year one.
The Numbers on a $350,000 Home
Start with a $350,000 purchase. You live there two years, then rent it for three, claiming depreciation the whole time. Assuming 6.7% annual appreciation, the property sells for $484,050 just before the five-year mark.
At that point you’ve accumulated $134,050 in true capital gains and $38,182 in depreciation — the latter reducing your cost basis during the rental years. Section 121 eliminates the capital gains tax on the entire $134,050. In a 15% bracket, that’s a tax bill that simply disappears.
What remains is the depreciation recapture. The IRS taxes that at your personal tax bracket rate, up to 25%, and 25% of $38,182 is $9,545. That’s your total tax on a $134,050 gain — and as the source notes, that figure is roughly equal to the income tax you saved by claiming the depreciation in the first place, making it essentially a wash.
Order Matters: Live First, Rent Later
The sequence — residence first, rental second — produces a dramatically different result than the reverse. If you rent the property for three years first, and then move in for two, the IRS allocates gains proportionally. Only two-fifths of the capital gains qualify for the Section 121 exclusion; the remaining three-fifths are fully taxable.
Using the same $350,000 example in reverse order, the tax bill climbs to $21,610 — more than double — even before considering whether a 1031 Exchange could defer the taxable portion. Doing it in the right order cuts that to $9,545 with no exchange required.
One Structural Requirement
To qualify for Section 121 in this strategy, you must have purchased the property in your own name or through a single-member LLC treated as a disregarded entity for tax purposes. The statute requires that you actually owned the property during the period you claim as your qualifying residence. A partnership or corporation won’t satisfy that test.
Why This Is the Foundation of a Long-Term Plan
Section 121 is described here as the best section of the tax code for the individual taxpayer; Section 1031 is the best for the real estate investor. Used together across a lifetime, they can eliminate capital gains entirely in some situations and defer them indefinitely in others. The live-first, rent-later sequence is the cleanest expression of that combination — a strategy that converts an ordinary home purchase into a nearly tax-free payday with one straightforward condition: sell before the five-year clock runs out.