Quick Read
Spending two years in a rental before selling it does not eliminate the tax; the exclusion only applies to the portion of the gain tied to the time you used it as your residence.
Depreciation recapture is never shielded, because the home-sale exclusion does not cover gain attributable to depreciation claimed after May 1997.
If you first lived in the home and later rented it out, then sold it within five years, you may exclude the full gain up to the limit, aside from depreciation.
Building a portfolio and living off one are very different skills, and few people teach the second. That is what The Definitive Guide to Retirement Income aims to help with, and it is free today. (Sponsor)
A reader who owns a rental property and has lived in it for more than two years wrote in after seeing a common piece of advice repeated online. The claim says that if you live in a rental for two years before selling, both capital gains tax and depreciation recapture disappear. After reviewing IRS material, the reader concluded that the exclusion only covers the time actually spent living in the home. In their example, selling after 10 years and living there for the last two would leave only 20% of the tax avoided. They asked whether that understanding was wrong.
For the most part, it is not wrong. The reader has been more careful than many of the articles repeating the shortcut, and a few important details make the situation clearer. One of them makes the popular advice look even less favorable.
What the Reader Is Really Deciding
The real issue is how much of the profit the home-sale exclusion can reach when a property was a rental for years before becoming a primary residence. Three factors determine that share: when the rental period occurred, whether the owner rented first or lived there first, and how much depreciation accumulated while the property was rented.
Now Available: The Definitive Guide to Retirement Income
Many successful investors eventually reach the same turning point. The saving is done, the portfolio is built, and the question shifts from how much can be accumulated to how much can be safely withdrawn. Getting that second question wrong can undo decades of good investing in only a few years.
Rental Years After 2008 Reduce the Exclusion
Under 26 U.S.C. § 121(b)(5)(A), gain tied to periods of “nonqualified use” cannot be excluded. In simple terms, that means time when the property was not your main home, such as years it was rented out. Section 121(b)(5)(B) allocates the gain by using the ratio of nonqualified-use time to total ownership time. That matches the time-based proration the reader described.
The qualified portion still has to meet the basic rule. Section 121(a) requires that you owned and used the home as your principal residence for periods adding up to at least two years during the five-year period ending on the sale date. The reader’s stay satisfies that test. For 2025, IRS Publication 523 limits the exclusion to $250,000, or $500,000 for married couples filing jointly.
One date matters to landlords. Section 121(b)(5)(C)(i) excludes any time before January 1, 2009, from the definition of nonqualified use. Rental years before 2009 do not reduce the exclusion. The reader’s calculation works fully only if every rental year came after 2008.
Living There First Changes the Outcome
The order of renting and living in the property matters a lot. Under Section 121(b)(5)(C)(ii)(I), any part of the five-year window that falls after the last day the home was your principal residence does not count as nonqualified use. Publication 523’s 2025 worksheet reflects this by tracking the days after the last day the property was used as the main home during the five years before the sale.
Depreciation Recapture Gets No Shelter
Depreciation recapture is the tax on the portion of profit equal to depreciation deductions claimed while the property was a rental. On this point, the common advice is simply incorrect. Section 121(d)(6) says the exclusion does not apply to gain equal to depreciation adjustments for periods after May 6, 1997. The amount of time later spent living there does not change that.
Section 121(b)(5)(D) establishes the sequence. The depreciation portion is taxed first. Only after that does the nonqualified-use ratio apply to the remaining gain. In the reader’s 10-year example, the 20% applies only to what is left after depreciation, not to the full profit or the entire tax bill. It is one of the quieter IRS rules that can erode a retirement sale, and we mapped it along with eight others in a free tax-trap guide.
What We Would Want to Know Before Deciding
Bottom Line for This Reader
The reader is mostly correct. If the property was rented after 2008 and lived in later, only the portion of non-depreciation gain tied to the years spent living there can be excluded. Depreciation recapture is taxed in full regardless. The result improves significantly if some rental years occurred before 2009, or if the owner lived in the home first, rented it out later, and sold within the five-year window.
Released: The Definitive Guide to Retirement Income
(Sponsor) Most people spend their working lives focused on one goal: building a larger nest egg. Then they retire and realize the skill they actually need is almost the opposite—turning that nest egg into steady income, year after year, in good markets and bad, without running out.
It may be the least discussed and most important transition in personal finance, and many otherwise careful investors approach it without a real plan. That is exactly what The Definitive Guide to Retirement Income helps explain. It is a free guide from Fisher Investments that covers what retirement will really cost, where the cash flow should come from, and how much can be withdrawn safely each year. Learn more here.
More from Digilifetrends
Reverse Mortgages Make Sense Only for Lifelong Homeowners — Start by Comparing Cheaper Alternatives
Once you turn 62, a reverse mortgage can convert home equity into cash without monthly payments, but the upfront charges can reach thousands of dollars and the loan balance keeps…
2 min read · Published 2026-11-29Buying a Home With a Friend? Put a Co-Ownership Deal in Place Before Closing
Buying a house with a friend can be a workable arrangement, but the lender still considers each borrower responsible for the full mortgage. That is why it is important to have a…
3 min read · Published 2026-11-29Buying a Condo: HOA Records Can Reveal an Upcoming Special Assessment
A condo’s purchase price covers your unit, but the association’s finances determine what you may owe after you move in. Before your deposit becomes nonrefundable, review the HOA…
2 min read · Published 2026-11-29