Converting a rental property to a primary residence does not wipe out your capital gains the way most landlords think it does. Since a 2008 change to Internal Revenue Code Section 121(b)(5), the years you rented the property after 2008 count as "non-qualified use," and a proportional slice of your gain is carved out of the exclusion. Depreciation recapture sits on top of that, separately, whether or not you ever claimed the depreciation. For a long-time landlord, the two-year move-in strategy often saves a fraction of what a back-of-envelope calculation suggests.
The version everybody knows
Section 121 lets you exclude up to $250,000 of gain on the sale of your primary residence, or $500,000 if you are married filing jointly, as long as you owned and lived in the home for two of the previous five years.
That rule is real, and it is generous. It is also the version that gets repeated at dinner parties, in landlord Facebook groups, and — I will be honest — by more than a few agents. The logic sounds airtight: I have a rental with a lot of equity, I move into it for two years, I sell, the gain is excluded.
If you bought the rental before 2008 and rented it the whole time, that logic is wrong by a wide margin.
What changed in 2008
The Housing Assistance Tax Act of 2008 added subsection (b)(5) to Section 121. It created the concept of non-qualified use: periods after January 1, 2009, when the property was not your principal residence.
The mechanic is a ratio. You take the non-qualified use years, divide by the total years you owned the property, and that fraction of your gain is ineligible for the exclusion. It does not matter that you satisfy the two-out-of-five-years test. You still pass that test. The exclusion just gets shrunk before it is applied.
A rough shape of it, using round numbers:
- You bought a rental in 2010 and rented it for 14 years.
- You move in for 2 years and sell in 2026. Total ownership: 16 years.
- Non-qualified use: roughly 14 of 16 years, or about 87.5 percent of the ownership period.
- Roughly 87.5 percent of your gain is knocked out of exclusion eligibility before you get to apply the $250K / $500K cap.
If your gain is $600,000, you are not excluding $500,000. You are looking at a small fraction of it.
Depreciation recapture is a separate hit
This is the part landlords consistently forget, and it is not affected by Section 121 at all.
Every year you held that property as a rental, you were entitled to depreciate the building. The IRS recaptures that depreciation on sale at a rate up to 25 percent federally — and it does so based on depreciation taken or allowable. If your accountant never claimed it, the IRS still assumes you did.
So a landlord who skipped depreciation for a decade thinking they were keeping things simple gets recaptured anyway. That is a bad surprise to find in escrow.
California, for its part, does not have a preferential capital gains rate. Gain is taxed as ordinary income at state rates. That is a meaningful layer on top of the federal math for anyone in a high bracket.
When the move-in strategy still works well
It is not a dead strategy. It works when the non-qualified ratio is small:
- Recent conversions. You bought the place as a home, lived in it, then rented it out for a couple of years before moving back. Post-2008 rental years are a small slice of total ownership.
- Short rental histories. A property rented two or three years out of a fifteen-year hold.
- Situations where the exclusion is a bonus, not the plan. You wanted to live there anyway, and the tax treatment is upside.
There is also a useful asymmetry worth knowing: rental use after the property has been your primary residence is generally not treated as non-qualified use under the same rule. Order matters. Home first, then rental, is treated differently than rental first, then home.
When it does not work
Long-time landlords. If you have held and rented a property for a decade or more since 2009, moving in for two years buys you a fraction of the exclusion, costs you two years of rental income, ties up your housing decision, and does nothing at all about depreciation recapture.
I had this exact conversation with a client last year who was planning a move out of state and wondering whether to keep his rental or move back in and sell. He had run the numbers assuming a clean $500,000 exclusion. Once we walked the non-qualified use ratio and the recapture together, the two-year plan stopped making sense — and a completely different strategy did.
What to do instead of guessing
Three things, in this order.
- Pull your actual cost basis and depreciation schedule. Not your estimate of it. The real numbers from your returns. Most of the bad math I see starts with a wrong basis.
- Have a CPA run the comparison. Move-in-then-sell versus a 1031 exchange versus an installment sale versus simply holding and letting your heirs take the stepped-up basis. These produce dramatically different outcomes, and the right answer is genuinely situational.
- Only then talk about timing and pricing. Which is where I come in. Once you know the tax shape of the decision, the real estate strategy is straightforward.
This is general educational content, not tax advice. Speak with a licensed CPA before making decisions about converting a rental property to a primary residence.
Frequently Asked Questions
If I move into my rental for two years, do I avoid capital gains tax?
Not fully, and often not close to fully. You will satisfy the two-of-five-years use test, but Section 121(b)(5) removes a proportional share of your gain from exclusion eligibility based on the years the property was rented after 2008. The longer you rented it, the smaller the benefit.
What is non-qualified use under Section 121?
It is any period after January 1, 2009 during which the property was not your principal residence. The ratio of non-qualified use years to total ownership years determines how much of your gain cannot be excluded.
Does depreciation recapture go away if I convert the rental to my home?
No. Depreciation recapture is calculated separately and is not covered by the Section 121 exclusion at all. It applies to depreciation taken or allowable, so it applies even if you never actually claimed it.
Is a 1031 exchange better than moving in and selling?
Often, for long-time landlords — but it depends on whether you want to stay in real estate. A 1031 defers tax by rolling into another investment property. Moving in and selling attempts to eliminate some tax but forces you to live there. Different goals, different answers.
Does California treat this differently than the IRS?
California conforms to the federal Section 121 exclusion but does not offer a preferential capital gains rate. Taxable gain is treated as ordinary income at state rates, which raises the cost of getting the strategy wrong here versus in a no-income-tax state.
I am a landlord in Los Angeles thinking about selling. Where do I start?
Start with your cost basis and depreciation schedule, then a CPA conversation, then a market conversation. Reversing that order is how people end up committed to a plan that does not pencil.