How To Use The Tax-Free Home Sale Exclusion Every Two Years To Save

In Spring 2025, I sold one of my properties and will successfully exclude $500,000 in capital gains, tax-free, thanks to the IRS Section 121 Exclusion. For those unfamiliar, this powerful rule allows homeowners to exclude up to $250,000 in capital gains if single, or $500,000 if married filing jointly, from the sale of a primary residence—as long as they meet the ownership and use tests.

Several months later, I’ve just been notified by my tenant that they’re vacating one of my rental properties at the end of their lease next month.

Given the San Francisco real estate market remains relatively strong, I’m now faced with a choice: Do I sell the property and take advantage of favorable pricing? Or do I hold onto it, boost my semi-passive income, knowing that if I wait until 2027, I could potentially exclude another $500,000 in capital gains—tax-free?

Let’s walk through how the exclusion works, how often you can use it, and why understanding this rule could save you six figures in taxes.

What Is the Section 121 Exclusion?

Under Section 121 of the IRS code, you can exclude up to $250,000 in capital gains ($500,000 if married filing jointly) from the sale of your primary residence, as long as:

  1. You’ve owned the property for at least two out of the last five years, and
  2. You’ve lived in the property as your primary residence for at least two out of the last five years.

You can only use this exclusion once every two years. If you sell another home within two years of your last excluded gain, you cannot claim the exclusion again.

This rule doesn’t just apply to homes you’ve always lived in. It can also be used on properties that were previously rented out, if you meet the timing requirements.

Why This Matters: My February 2025 Sale

In February 2025, I sold a home I had lived in from 2020 to late 2023. I moved out and rented it for 12 months before prepping and selling. Because I had lived in it for at least two of the past five years before the sale, I qualified for the full $500,000 exclusion.

Let’s say I bought the home for $1,000,000 and sold it for $1,800,000.

  • Total capital gain: $800,000
  • Section 121 exclusion: $500,000
  • Depreciation recapture: $10,000 (taxed at 25%)
  • Remaining long-term capital gain: $300,000

The $10,000 of depreciation recapture is not covered by the exclusion and will be taxed at up to 25%, or $2,500. The remaining $300,000 in capital gains will be taxed at long-term capital gains rates (typically 15%–20%, plus state taxes and possibly the 3.8% NIIT). We're talking up to 33.8% in capital gains tax here in California!

Assuming I did zero remodeling, my total taxable gain is $315,000, split between depreciation recapture and regular LTCG. That's a painful ~$104,000 in long-term capital gains taxes.

Still, I saved $150,000+ in taxes by taking advantage of the exclusion. To be specific: $500,000 X 33.8% = $169,000 in taxes I would have to pay if there was no exclusion! Even with prorating my capital gains, I get to use the full exclusion amount.

The New Opportunity: Rental Property Tenant Gave Notice

Fast forward to today. A tenant in one of my other rental properties just gave notice. They’ve been there since January 2020, and I haven’t lived in the property since. Let's say I bought the house in 2012 for $700,000 and is now worth $1.5 million.

If I sell it now, my capital gains would look something like this:

  • Sale price: $1,500,000
  • Original cost basis: $700,000
  • Improvements over the years: $50,000
  • Adjusted cost basis: $750,000
  • Depreciation taken over rental period (5 years): $100,000
  • Adjusted basis after depreciation: $650,000 ($750,000 cost basis minus depreciation)
  • Capital gain: $1,500,000 – $650,000 = $850,000
  • Depreciation recapture (taxed at 25%): $100,000 = $25,000
  • Selling commission and transfer taxes: $80,000
  • Remaining gain: $670,000 (taxed at long-term cap gains rate)

Because I haven’t lived in the property for two of the past five years, I cannot take the Section 121 exclusion—at least not yet.

But what if I leave my current ideal home for raising a family and move back in to this rental, which I called home from 2014-2019?

Moving Back In: The Two-Out-of-Five-Year Rule

To qualify for the exclusion again, I need to:

  • Wait at least two years from my last use of the exclusion (February 2025 → February 2027), and
  • Live in the property as my primary residence for at least two years within the five-year window before selling.
  • Figure out the pro-rated amount I can exclude

So, here’s a possible game plan:

  1. September 2025: Tenant leaves. I move back in and make it my primary residence.
  2. February 2027: I become eligible to use the exclusion again, two years after the February 2025 sale of another home.
  3. September 2027: After two full years of living there, I meet the two-out-of-five-year use requirement again.
  4. Fall 2027: I sell and exclude $500,000 in gains—tax-free after calculating prorated capital gains.

Let’s look at the revised tax math.

Selling in 2027 (Two Years Later) With Exclusion

  • Sale price: $1,550,000 (assuming modest $50,000 appreciation)
  • Adjusted basis: $650,000 ($750,000 original cost basis minus $100,000 depreciation taken over the years)
  • Total capital gain: $900,000 ($1,550,000 – $650,000)
  • Prorated Section 121 exclusion:
  • I lived in the property as my primary residence for 8 of the 13 years I owned it.
  • That’s 8 ÷ 13 = 61.54% of the gain eligible for exclusion.
  • Eligible gain = $900,000 × 61.54% = $553,860 (eligible for exclusion, up to the $500,000 cap for married filing jointly).
  • Because the cap is $500,000, I can only exclude $500,000, but at least I get to exclude the full $500,000.
  • Ineligible gain due to non-qualified use: $900,000 – $553,860 = $346,140 (taxable).
  • Depreciation recapture: $100,000 (taxed separately at up to 25% = $25,000 tax).
  • Selling commission and transfer taxes: $80,000 (reduces taxable gain).
  • Remaining capital gain subject to LTCG tax:
  • $346,140 – $80,000 = $266,140 (taxed at my applicable long-term capital gains rate, plus NIIT if applicable).

Do I really want to pay long-term capital gains tax on $266,140? Not really. Although I had to pro-rate the exclusion amount, I still get to use the full $500,000 in tax-free exclusion amount to save ~$169,000 in long-term capital gains taxes. The reason is because my pro-rated amount is still higher than the $500,000 tax-free exclusion amount for married couples.

In other words, you can literally do the math to calculate when is the ideal time to sell your rental property to take 100% of the tax-free exclusion amount and not pay any long-term capital gains tax.

Moving back in to the rental to unlock the tax free benefit before relocating to Honolulu feels like a financially prudent decision.

Another option is doing a 1031 exchange to defer all taxes by reinvesting the proceeds into a rental property in Honolulu. But the idea of taking on another rental and all the responsibilities that come with it feels less appealing these days.

Prorated Exclusion If I Sell Early

What if I decide to sell before September 2027—before hitting the full two-year residency again?

There’s a little-known rule that allows for a partial exclusion if you sell early due to an unforeseen circumstance, job change, health issue, or other qualified reason. But it’s tricky, and the IRS is strict about qualifying.

Partial Exclusion = (Months of ownership and use / 24) × $250,000 (or $500,000)

The safest move is to wait the full 24 months before selling.

Just know that you must prorate the tax-free exclusion amount if you rented out the property after 2009 during non-qualifying years. The longer the property is used as a rental, the smaller the tax-free exclusion you can claim.

Example Of Pro-Rating The Tax-Free Exclusion

Here's another example below:

  • You bought a home in 2015.
  • You lived in it as your primary residence for 6 years (2015-2021).
  • Then you rented it out for 2 years (2021-2023).
  • You sold it in 2023 with a $600,000 gain.
  • You’re married filing jointly, so normally you’d qualify for the $500K exclusion.

But here’s the catch:

Because 2 of the 8 years of ownership (2019–2022) were non-qualified use, you must prorate the exclusion:

Non-qualified use ratio = 2 years / 8 years = 25%

Gain ineligible for exclusion: 25% × $600,000 = $150,000

Gain eligible for exclusion: $600,000 – $150,000 = $450,000

Since the eligible amount ($450,000) is under the $500,000 married-filing-jointly limit, you can exclude the full $450,000.

Taxable gain: $150,000 ($600,000 minus the $450,000 pro-rated tax exclusion amount)

Could Have Gone Back To Live In The Unit To Save More

In the above scenario, you’d be leaving $50,000 in tax-free capital gains on the table. Ideally, you would move back into your home for another four and a half years, making it your primary residence for 10.5 out of 12.5 years.

The ineligible gain for exclusion would then be 16% (2 ÷ 12.5). $600,000 × 16% = $96,000.

That leaves $504,000 eligible for exclusion. You could then use the full $500,000 tax-free allowance and owe long-term capital gains tax on only $4,000. So even more precise, you should go back and live in your rental for four years and nine months (3 more months) to get the full $500,000.

I'm not a CPA, so please double check with a tax or real estate professional. But paying long-term capital gains tax on a $150,000 gain is far better than paying taxes on a $450,000 or $600,000 gain. As you can see from the examples, the bigger your capital gains, even with the pro-rated exclusion, the greater your ability to take 100% of the tax-free exclusion amount.

Important note:

  • Since the Housing Assistance Tax Act of 2008 took effect, any rental period after 2008 before the property became your primary residence does count as nonqualified use and will reduce the amount of gain you can exclude under §121. Specifically, for sales after January 1, 2009, any rental period before the property became your primary residence counts as nonqualified use and reduces the portion of gain you can exclude under §121, as shown in the IRS “Finley” example in Publication 523.

Downsides and Considerations To Moving Back Into The Rental

Of course, there are tradeoffs to saving money on capital gains tax.

  • I'll have to live in the rental again, which is not ideal since it is smaller than my current residence with only one en suite bathroom
  • The property won’t generate rental income during those two years.
  • If the market weakens, I might give up gains or deal with less favorable selling conditions.
  • Depreciation recapture never goes away, it will always be taxed.
  • I'd have to rent out my existing house, keep it empty, or sell it, which would create the same problem. You can't have two primary residences according to the IRS.
  • Every time there is a property sale, there is economic waste in terms of fees, taxes, and commissions

As you can see, moving back into a rental to try and save on capital gains taxes isn't always a straightforward decision. But even with these downsides, the $500,000 exclusion can more than make up for the short-term discomfort.

Strategy Summary Using The Tax-Free Home Sale Exclusion Rule

Here’s the big picture:

ActionTimingTax Benefit
Sold property A in Feb 2025Met 2 of 5 rule$500K gain excluded
Move into property B in Sept 2025Start clockLiving requirement begins
Become eligible again in Feb 20272 years since last exclusionCan exclude again
Sell property B in Sept 2027Full 2 years of primary residence metExclude another $500K gain after calculating the prorated capital gains amount

By leapfrogging primary residences and planning around the two-year exclusion rule, it’s possible to exclude millions in gains over your lifetime.

Minimize Capital Gains Taxes Where You Can

The $500,000 tax free home sale exclusion is one of the most powerful tools in the tax code for building and preserving wealth. No other asset class offers this kind of benefit except for Qualified Small Business Stock, which comes with its own challenges. But like most good things, the exclusion requires patience, planning, and sometimes a little sacrifice.

Personally, I’ve decided to wait until September 2027 to even consider selling the rental property—if my tenants vacate before then. That’s a big if, as they could easily stay for many more years. In that case, I’d still be able to fully utilize the tax-free exclusion by selling my current primary residence instead. In the meantime, my focus is on optimizing passive income as much as possible.

If you have a rental with significant appreciation and flexibility in your living situation, it could be worth the effort to move back in for two years to reset the clock on the exclusion.

After all, saving $100,000 to $169,000 in taxes every two years is like earning an extra $50,000 to $84,500 a year completely tax free. Earning $500,000 in tax-free real estate gains is also like earning ~$750,000 in the stock market and paying no taxes. Not a bad strategy for those who like to optimize their finances.

Even Easier For Non-Rental Property Owners

Alternatively, if you are climbing the property ladder toward nicer homes, you can keep using the $250,000 or $500,000 capital gains exclusion with each sale. Sell four homes in your lifetime and you and your spouse could legally avoid taxes on up to two million dollars in capital gains. That equates to about $500,000 in tax savings. There’s no need to prorate the tax-free exclusion amount either since you did not rent out your homes.

Then when you finally find your forever home, your heirs benefit from a stepped up cost basis when you pass so they may avoid capital gains taxes as well. Pretty awesome tax benefits if you ask me.

Homeownership remains one of the most accessible ways for most people to build lasting wealth. Between forced savings through mortgage payments, inflation pushing up rents and home values, and the power of leverage, the average homeowner is far wealthier than the average renter. Yes, renters can invest the difference and potentially make more money, but statistically most do not consistently over time.

So if the government offers generous tax breaks to encourage homeownership, we might as well take full advantage. It is one of the few legal ways left to build wealth tax efficiently and potentially pass it on tax free.

Readers, anybody ever move back to a rental property and live in it for two years to take advantage of the tax-free home sale exclusion rule?

Diversify Into Passive Private Real Estate 

If you are tired of being a landlord, consider diversifying into private real estate instead. Fundrise is a platform that lets you invest 100 percent passively in residential and industrial properties across the country. With nearly $3 billion in real estate assets under management, Fundrise focuses on the Sunbelt region, where valuations are generally lower and yields tend to be higher.

No more dealing with tenants, maintenance issues, or turnover. Instead, you can gain exposure to a diversified portfolio of private real estate without the day to day hassle.

I have personally invested over $150,000 with Fundrise real estate. For new investors, you can get a $100 bonus if you invest over $10,000 and a $500 bonus if you invest over $25,000. They have been a trusted partner and long time sponsor of Financial Samurai. With just a $10 minimum investment, adding real estate to your portfolio has never been easier.

Invest in Fundrise CRE and private AI companies to diversify beyond just 529 plan contributions
My Fundrise investment dashboard, which includes my investment in the Innovation Fund (venture capital)

Subscribe To Financial Samurai 

Listen and subscribe to The Financial Samurai podcast on Apple or Spotify. I interview experts in their respective fields and discuss some of the most interesting topics on this site. Your shares, ratings, and reviews are appreciated.

To expedite your journey to financial freedom, join over 60,000 others and subscribe to the free Financial Samurai newsletter. Financial Samurai is among the largest independently-owned personal finance websites, established in 2009. Everything is written based on firsthand experience and expertise.

Subscribe
Notify of
guest


17 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
anon
anon
14 days ago

Does Fundrise accept 1031 exchange funds? My plan is to sell my rentals eventually and 1031 into something commercial with a longterm NNN lease. I’m getting sick of dealing with residential properties, but I can’t bring myself to pay a property manager.

Marina
Marina
16 days ago

Hi Sam,
Would you please provide more info on this note in your article?
Important note:
Non-qualified use before the property was ever a primary residence does not count against you (e.g., if you rented it first, then lived in it, you’re OK).

I bought rental properties and never lived in them. How would the exemption work in the below example?
– Buy rental property in 2010 for $300,000
– Rent out for 15 years to 2025
– Move in as primary residence for 2 years: 2025-2027
– Sell property in 2027 for $1,000,000

Are my husband and I able to exclude the full $500,000 or do we need to prorate the gain?

Thanks for this article. I too have been thinking about my exit strategy and if it’s worthwhile to move into the rental for a couple of years.

Deborah
Deborah
16 days ago

Hi Sam,
what if you bought a house, rehabbed it for a year, moved in for a year and then sold it, is that 2 years/out of 5? Does the clock start at the the closing?

James
James
20 days ago

You can actually do both a 121 exclusion AND a 1031 Exchange. Basically if your gain is over 250k/500k, you can then section 1031 exchange the remaining into a new rental property, and then repeat the process. See the third example here: https://www.exeterco.com/article_overview_1031_121_combination

Alex
Alex
20 days ago

You should factor in the lost rental income in your calculations since it is an opportunity cost.

If deciding to move back into your rental to save on the capital gains, you should subtract the rental income you would have earned (had you rented out the place) from the tax savings you would receive.

Robbie
Robbie
20 days ago

How do you have these huge gains on real estate? I’ve owned properties for 30 years and would love to have a gain that was even close to hitting the $500K max.

Robbie
Robbie
20 days ago

I owned in another West Coast city (Portland metro) and haven’t fared as well. One home appreciated 100% but the other 2 haven’t moved in price since 2008. Glad to hear SF has rebounded, hopefully that carries over to the other major west coast cities.

FZ
FZ
22 days ago

Be careful – one also have to prorate the Sec121 allowance by excluding the amount of appreciation associated with the time when the property was under non-qualified use (rental) since you own it (or from 2010, whichever is earlier), thus potentially significant reducing the final capital gain tax exemption amount (250/500)

Rahul Banerjee
Rahul Banerjee
22 days ago

Sam, curious to hear other folks views on what would be the best way for someone that no longer lives in their primary property that has appreciated to recoup some of the $500K in capital gains if they have moved on to another state and live there?

Jamie
Jamie
22 days ago

Thanks for highlighting and explaining all the rules. Sounds like a pita to have to move your whole family again. But at least you know that option exists and it can benefit those with easier moving logistics. With the big price points of real estate it’s definitely worthwhile to be aware of and understand all of the various related tax laws. thanks!