Rental tax strategy
Converting a rental back to your home: what the "two-year rule" actually saves you
The advice is everywhere: move back into your old rental for two years, then sell, and skip the capital gains tax. It sounds clean. It is also, for most landlords, wrong — and the reason is a proration rule that turns on the order you used the property, not the dollars involved.
A few years into owning my Alexandria condo, I found out I'd never claimed depreciation on it. Fixing that meant amending returns — and then discovering the flip side: all that depreciation comes back as tax when you sell. So when I first read the "just move back in for two years" tip on a landlord forum, I wanted it to be true. I ran the numbers on my own place. It is not nearly the tax-free exit people think it is, and the gap between the folk wisdom and the arithmetic is where this article lives.
Here's the short version, then the long one. The home-sale exclusion under Internal Revenue Code Section 121 can shelter up to $250,000 of gain if you're single, or $500,000 married filing jointly. Converting a rental into your primary residence can get you back into it. But two rules quietly gut the benefit for anyone who rented the property for a meaningful stretch: the exclusion never touches depreciation recapture, and the years you rented count as "nonqualified use" that proportionally shrinks what you can exclude.
Two taxes on the way out, and the exclusion only fights one
When you sell a property that was ever a rental, the gain splits into two very different piles.
The first is depreciation recapture. Every year you rented, you deducted depreciation — and the IRS wants that benefit back when you sell. It comes back as "unrecaptured Section 1250 gain," taxed at a rate up to 25%. The catch that surprises people: it's based on depreciation allowed or allowable, so you owe it even if you never actually claimed the deductions. That was very nearly my situation.
The second pile is your ordinary capital gain — appreciation above your adjusted basis — taxed at long-term rates (0%, 15%, or 20%, plus a possible 3.8% net investment income tax and state tax on top).
Section 121 does nothing about the first pile. Under Section 121(d)(6), the exclusion cannot shelter any gain attributable to depreciation taken after May 6, 1997. So the very first thing to understand is this:
No matter how the two-year move-back plays out, every dollar of depreciation recapture is still owed. The exclusion only ever works on the appreciation.
On my condo, accumulated depreciation is about $128,000. That's roughly $32,000 of recapture tax that the "move back in and skip the tax" plan does absolutely nothing about. Any honest version of this strategy starts by setting that number aside.
The rule nobody explains: sequence beats dollars
Now the part that decides whether the move-back is worth it at all — and the part every generic article skips.
When a property has been both a rental and a home, Section 121(b)(5) prorates your exclusion. The gain (after recapture is carved out) gets split between qualified use — time it was your principal residence — and nonqualified use — time it wasn't. Only the qualified slice is excludable. The proration is a simple ratio: nonqualified days divided by total days you owned it.
But there's a crucial exception buried in the statute. Nonqualified use only counts for periods before the last date the property was your principal residence. Rent it and then move in, and those rental years are nonqualified. Live in it and then rent it, and — within the five-year window — those rental years often aren't nonqualified at all.
The cleanest way to see it is to take one example and run it in both directions. These are the same dollars and the same eight years; only the order changes.
Rent first, then move in
Rent 6 years, convert, live 2 years, then sell. $50k depreciation, $250k total gain.
Live first, then rent
Live 6 years, rent 2 years, then sell. Same $50k depreciation, same $250k total gain.
Assumptions: eight years owned, $250,000 total gain, $50,000 depreciation, married filing jointly. The rent-first column counts the two-year use test in calendar months, which is how the published example counts it — on a strict day count that column misses by one day and excludes nothing. That is the next section, and it is not a rounding quibble.
Two hundred thousand dollars of taxable gain on the left; zero on the right. Same property. The rental years on the right land after the last date it was a home and inside the five-year lookback, so the exception wipes them out of the nonqualified count. On the left, the rental came first, so it counts in full. (The rental-first figures follow the worked example the AICPA's Tax Adviser published in 2024; I reproduced them, then flipped the sequence.)
The recapture, you'll notice, is $50,000 in both columns. It doesn't care about sequence. Nothing shelters it.
The "live there two years" test isn't rounded generously. You need two full years — and there's a real question of whether that's counted in months or days. In the rental-first example above, the taxpayers convert on January 1, 2022 and sell December 31, 2023. That's 729 days. On a strict day count, that's one day short of the 730 needed — and in that example, one day is the difference between excluding $50,000 of gain and excluding nothing.
Don't cut it close. Give yourself a clear margin past two years, and don't schedule a closing that lands on the knife's edge of the anniversary.
How the proration math actually works
If you want to check anyone's numbers — including the calculator below — the order of operations is fixed, and getting it wrong is exactly how several of the big real-estate sites publish wrong figures:
- Adjusted basis = purchase price + capital improvements − depreciation (allowed or allowable).
- Total gain = sale price − selling costs − adjusted basis.
- Carve out depreciation recapture first. That slice is taxed at up to 25% and is never excludable.
- Prorate what's left. Multiply the remaining gain by (nonqualified days ÷ total ownership days). That product is your taxable capital gain; the rest is eligible for the exclusion, up to the $250k / $500k cap.
One quirk worth knowing, because it works in your favor: the nonqualified count in the numerator only includes periods after December 31, 2008 (when the rule took effect), but the denominator is your entire ownership period. For a property held since well before 2009, that mismatch quietly shrinks the ratio. It reads like a drafting oversight, and several commentators think it is one — but it's the law as written.
My condo, and why "but I lived there first" doesn't save me
Here's where the clean rule meets a messy reality, using my actual property. I bought the Alexandria condo in 2013 for $505,000, put $8,476 of capital improvements into it, lived in it until spring 2019, and have rented it since. Current value about $686,000; accumulated depreciation $128,272.
One assumption worth making explicit, because nobody else on this topic does: when a home becomes a rental, its depreciable basis is the lesser of adjusted cost basis or market value on the conversion date (Reg. §1.168(i)-4(b)). I've depreciated the full purchase price, which is only correct if the condo was worth at least what I paid when I converted it in April 2019. Over 2013–2019 in Alexandria it comfortably was, so the figures below stand. If you converted during a downturn, yours may not — your depreciable basis would be the lower market value, and you have very likely over-depreciated. The calculator has a field for this.
By the sequence rule above, I'm supposedly on the lucky side — I lived in it first. And I would be, if I sold within the five-year window. But I've now rented it for over seven years, which means I've blown the use test: to exclude anything, I need two of the last five years as my principal residence, and I haven't lived there since 2019.
Sell now, no move-back
Sell Aug 2026 at $686,000. Last lived there in 2019 — well outside the 5-year window.
Move back 2 years, then sell
Convert Aug 2026, sell Sep 2028 at $718,200. Requalifies — but reclassifies the rental years as nonqualified use.
Both columns assume 6% selling costs — $41,160 on the left, $43,092 on the right. That matters: comparing a sale with costs against one without would flatter whichever column skipped them. Other shared assumptions: married filing jointly, $75,000 of other taxable income, Virginia at 5.75%, depreciation frozen at $128,272 from the conversion date (it stops accruing the day it stops being a rental), and the two-year tests counted in days. "Proceeds before mortgage payoff" is the sale price less selling costs and all tax, with the loan not yet repaid — the sale calculator and keep-vs-sell tool report a figure that is net of the loan, so the names differ on purpose. The right-hand column carries two more years of appreciation, which is why its sale price is higher — and it does not charge itself the rent given up while living there. The calculator below does both.
So moving back does help. It takes my taxable capital gain from $131,364 down to $76,898, sheltering $84,734 that would otherwise be taxed, and cuts the tax bill from $62,585 to $48,349. But look at what that actually is: $14,236 of tax saved. The rest of the $44,504 gap between the two columns — $30,268 of it — is simply two more years of appreciation net of the larger sales commission, which I'd collect whether I moved in or not.
Fourteen thousand dollars is real money. It is not the "skip the capital gains tax" the forums promise. The act of moving back to requalify is exactly what flips my seven rental years into nonqualified use, so nearly half the remaining gain stays taxable. And the $128,272 of recapture doesn't move an inch — it's identical in both columns, because nothing shelters it.
That's the lesson the forums miss: "I lived there first" only protects you if you sell before the clock runs out. Once you've rented long enough that you have to move back to requalify, the move-back itself destroys the sequence advantage. You trade a full exclusion you can no longer reach for a prorated one you can.
And two years of housing yourself somewhere you'd otherwise be renting out is not free. Against $14,236 of tax saved, the rent you don't collect is the number that decides it — which is the whole reason the tool below charts forgone rent alongside the tax.
So should you move back in? Run your own timeline
There's a genuine optimization hiding here, and "two years" is only ever the minimum to qualify — which is why every generic article stops there and calls it the answer. Whether it's also the best year is a calculation. Each additional year you stay freezes the nonqualified numerator, grows the ownership denominator (shrinking the ratio), adds appreciation, and stops new depreciation — while costing you a year of rent you're no longer collecting.
For my condo the tension resolves at two years, but not for the reason the forums think. It's because $3,500 a month of rent nets more each year than the place appreciates, so every extra year I stay costs more than it saves. Change that balance — faster appreciation, or weaker rent — and the best year moves out. That's the calculation below, and it's different for every property.
The shape of that curve is worth a moment, because it isn't the simple hill you'd expect. Two years is the optimum. From there the net position falls every year, bottoms out at year eight, and starts climbing again at year nine — but climbing is not the same as catching up. At year ten, the last year the tool models by default, I'd still be about $8,000 behind where I'd have been selling at two. The slope turns at nine; the level doesn't get back to the year-two figure until year fifteen.
The mechanism is a race between two things that grow and one that doesn't. The nonqualified numerator freezes the day I move in while the ownership denominator keeps counting, so the excluded share improves a little more every year — and appreciation compounds on a rising base, so it adds more each year too. Against that, the rent I forgo is a flat $17,923 a year. Early on the flat drag wins easily; the compounding eventually out-runs it, but by then it's spent thirteen years digging out of the hole it made.
What the optimizer leaves out — and it's the biggest number here
The chart charges you the rent you stop collecting. It does not credit you the housing you stop paying for. That gap is deliberate — I don't know where you'd otherwise be living — but you have to close it yourself before the answer means anything.
Here it is unsoftened, for my own property. Moving back for the 26 months from August 2026 to September 2028 saves $14,236 in tax and costs $38,833 in net rent I no longer collect. On the optimizer's terms, that is not a win at all — it's about $24,600 worse off. Two years of rearranging my life to end up twenty-four thousand dollars down.
That is the complete picture only if you'd otherwise be housed for free. If you'd be paying for somewhere to live, subtract it: the move-back breaks even at roughly $950 a month of rent avoided, and every dollar above that puts you ahead. In Old Town Alexandria $950 is nowhere near market, so for me the move-back probably does win once housing is counted — but it wins on the housing, not on the tax. The tax saving alone never covers the rent. Put your own housing cost against that $24,600 before you decide anything, and be honest about whether you'd actually want to live there.
Section 121 conversion calculator
Enter your purchase, your sale, your depreciation, and the actual stretches you lived in versus rented the property. It carves out recapture first, prorates what's left by your nonqualified-use share, checks all four eligibility gates, and charts how much you’d walk away with — before the mortgage is repaid — for each year you stay before selling.
s121 engineHow many years should you actually stay?
Two years is the minimum to qualify. Whether it's also the best year to sell is a separate question, and the answer swings on your own numbers: every extra year you stay freezes the nonqualified numerator, grows the ownership denominator, adds appreciation, accrues no new depreciation — and costs you a year of rent you're not collecting. Those pull against each other, so the best year is a real calculation, not a rule of thumb.
The rent figure is net, not gross — it's the cash the property actually throws off, which is the only part you lose by living in it. The default is this condo's: $3,500 a month gross, less 5% vacancy, less $10,680 of HOA, $7,214 of property tax, $723 of insurance and 8% of rent for maintenance, leaves $17,923 a year. Mortgage payments aren't in it — you make those either way. Put your own number in. If you want the full four-engine treatment of the keep side, that's the keep-vs-sell tool.
What it does. Adjusted basis → total gain → the §121(d)(6) depreciation carve-out first → then the §121(b)(5) proration on what's left → then the exclusion cap. That order is the whole trick; reversing the middle two steps is the most common way this gets computed wrong. Tax on the recognized gain runs the same Schedule D stacking as the sale calculator — recapture at ordinary rates up to a 25% ceiling, capital gain at the 0/15/20% breakpoints, plus the 3.8% NIIT and your state's cut.
What it deliberately doesn't do. The §121(c) reduced maximum exclusion for sales forced by a job change, health, or unforeseen circumstances — that prorates the cap rather than the gain, and it's a different mechanism. Also out of scope: married-filing-separately and surviving-spouse variants, partial business use or a home office inside the residence, installment sales, and non-resident state withholding. If any of those describe you, the number here is not your number.
Not tax advice. An estimate for planning. Confirm anything that matters with a CPA before you act on it — especially the day counts, which is where this rule bites hardest.
This one isn't built yet.
The export is next on the list: a dated PDF with your figures line by line, and a spreadsheet with the depreciation schedule and amortization laid out so you can check the math yourself. Something you can hand to your CPA, or put in front of the person you're making this decision with.
Leave your email and I'll tell you the day it's ready.
One email when it's ready. Unsubscribe anytime. Powered by Buttondown.
Before any of this: do you actually qualify?
The proration only matters if you clear the gates. All of these must be true, or the exclusion is zero:
- Ownership test — You owned the home for at least two of the five years ending on the sale date.
- Use test — You lived in it as your principal residence for at least two of those same five years. This is the one long-time landlords fail.
- No recent exclusion — You haven't claimed a Section 121 exclusion on another home in the two years before this sale.
- The five-year rule for 1031 property — If you acquired the property through a like-kind exchange, you must have owned it at least five years before the exclusion is available at all.
What this doesn't cover
This is the mainline case: a straightforward conversion, sold outright, one owner or a married couple. A few situations change the math and deserve their own look with a professional: sales forced by a job move, health, or unforeseen circumstances (which can prorate the cap rather than the gain), the interaction with suspended passive losses that release when you sell, installment sales, and any partial business use inside the home. And if you converted the property into a rental during a market dip, your depreciable basis may be lower than you assumed — which changes both your past deductions and your recapture.
I built the calculator to be right about the common case and honest about its edges. It flags where you're near a boundary and where a situation needs a CPA. It is not a substitute for one.
One rental-tax idea, worth your inbox
I write up the parts of the sell-or-keep decision that the calculators skip — recapture, conversions, 1031s, state stacking — with the arithmetic shown. No noise.
Occasional, unsubscribe anytime. Powered by Buttondown.