Should I sell rental property before the section 121 exclusion window closes?

Background: I bought my house in 2019, lived in it as my main home for about three years, then moved out and started renting it in mid-2022. I know there's a window where I can still qualify for the section 121 exclusion because I lived there the required time, but I'm not sure exactly when that window closes or how much of my gain I'd actually be able to exclude given the rental period. The house has appreciated a lot. I've read Publication 523 but the part about depreciation recapture and the nonqualified use rules made my head spin. My question is whether I should sell before the exclusion window closes, and if so, how to calculate what's actually excludable versus taxable. I've been trying to run the numbers myself but I'm not confident I'm getting the nonqualified use fraction right.

32 comments

The window is real and the math matters here. Under the ownership-and-use test, you need to have owned and used the home as your main residence for at least 24 months out of the 5 years before the sale date. The 5-year lookback rolls forward with every day that passes, so once fewer than 24 months of your personal use fall inside that 5-year window (roughly three years after you moved out, given about three years of use), the exclusion is gone unless a partial exclusion applies. With a mid-2022 move-out, that cutoff was around mid-2025, so it has likely already passed. The exact cutoff depends on the actual dates.

Maya L.

Author

That framing helps. So every day I wait, one more day of my qualifying use period drops off the back of the five-year window. I hadn't thought of it as a rolling cutoff before.

Worth separating the two things that will be taxable no matter what: depreciation recapture and the nonqualified use gain. Depreciation you claimed (or were allowed to claim) during the rental period is taxed as unrecaptured section 1250 gain at a maximum 25% rate — the exclusion does NOT shelter that. And the gain allocated to the nonqualified use period is also excluded from the section 121 exclusion. Nonqualified use is basically any period after 2008 when it wasn't your main home, with some exceptions for the period after your last day of use.

Maya L.

Author

So even if I sell within the window I'm still paying tax on the depreciation recapture, but the rental years after I moved out aren't nonqualified use. That changes the break-even calculation quite a bit.

Exactly on the depreciation. Run the numbers both ways. The exclusion still shelters the gain, including the part from the rental years after you moved out, which could be substantial. But depreciation recapture is a separate line item and it gets reported on Form 4797 and Schedule D regardless.

One thing people get wrong: the 24-month use requirement doesn't have to be one continuous block. You can aggregate qualifying periods within the 5-year window. But in your situation it sounds like you have one clean stretch of residence followed by rental, so you're not aggregating — you're just racing against the rolling window.

I uploaded my closing disclosure and depreciation schedule to taxr.ai and asked it to map out the nonqualified use fraction and the depreciation recapture amount. It drafted a worksheet showing each piece of the gain — the section 121 excludable portion, the nonqualified use slice, and the recapture — with the lines on Form 4797 and Schedule D where each piece lands. That breakdown made it much easier to take to my CPA and have a real conversation about timing. For the exclusion itself: Publication 523 has a Worksheet 2 (How To Figure Your Gain or Loss) that walks through the basis adjustments including depreciation claimed. That's the right starting point before you even get to the exclusion calculation.

Maya L.

Author

This is exactly the kind of output I need before I sit down with anyone. I'll try uploading my documents and see what it spits out for my numbers.

The nonqualified use fraction is calculated as: days of nonqualified use after 2008 divided by total days of ownership. The gain multiplied by that fraction is not excludable. Time after your last use date but before the sale is NOT nonqualified use — that's specifically excepted in the rules. So the rental period you're in now doesn't automatically become nonqualified use just because you're renting. The nonqualified use in your case is essentially zero if all your post-2008 rental started after you moved out as your main home.

That exception is important and a lot of people miss it. Post-use rental before the sale is excluded from the nonqualified use calculation, so the fraction can be smaller than people expect.

Maya L.

Author

Wait so my rental period that happened AFTER I moved out doesn't count as nonqualified use? That's a significant difference from what I had assumed. So my gain allocation might be better than I thought.

Right. The nonqualified use is use that occurred before your qualifying use period as your main home in a lot of scenarios. For your timeline — lived in it first, then rented — the rental after move-out is excepted. Read section 121(b)(5) or Publication 523's eligibility section for the specifics.

Don't forget that if you sell and have taxable gain after exclusions, you're also potentially looking at the net investment income tax depending on your income level. That adds to the effective rate on the nonexcluded portion. Worth modeling with your actual income numbers, not just the gain amount.

Ran into this situation last year. I pasted my depreciation history and my purchase and move-out dates into Taxr and asked it to check my gain allocation math. It compared my numbers to the Publication 523 worksheet steps and flagged that I'd been counting the post-move-out rental as nonqualified use, which was wrong. Saved me from overpaying. On the broader sell-or-wait question: if the exclusion window closes before you sell, you lose the exclusion on the entire gain, not just the rental-period portion. That's a large difference for an appreciated property.

Maya L.

Author

The part about miscounting the nonqualified use is exactly the mistake I was making. Good to know there's a way to sanity check the allocation before filing.

If you're close to the wire on the window and there's real money at stake here, an enrolled agent or CPA who handles real estate dispositions is worth the cost. The interaction between Form 4797 for the depreciation recapture, Schedule D for the capital gain, and the section 121 exclusion calculation is easy to get wrong and the IRS matches 1099-S proceeds against your return.

Maya L.

Author

1099-S matching is something I hadn't even thought about — if the closing agent files one, the IRS is definitely looking for the disposition on my return.

Correct, and Publication 523 is explicit: if you received a Form 1099-S, you must report the sale on Form 8949 even if your gain is fully excluded. Code H in column (f) and the excluded amount as a negative in column (g) — that's how you show the exclusion without leaving an unexplained gap.

How long have you actually owned the property total? That affects the size of the depreciation recapture exposure as much as anything. Four years of depreciation on a rental is a meaningful number depending on the building's value.

Maya L.

Author

Bought in 2019 so about six years total, roughly three as my home and just over three rented. The building value is significant so the recapture is real.

Sold a rental that used to be my home two years ago. The thing that surprised me most was that my adjusted basis after depreciation was quite a bit lower than I'd expected, which made the total gain bigger than my simple purchase-price-to-sale-price math suggested. Make sure you're using adjusted basis, not original cost, in your gain calculation.

Adjusted basis catches a lot of people off guard. Every year of depreciation reduces your basis, so the gain on disposition is larger than the appreciation alone. Form 4797 Part III is where the recapture flows for residential rental property with accumulated depreciation.

The partial exclusion rules are also worth understanding even if you think you'll make the full window. If a job change, health reason, or unforeseeable event forced an early sale, you might qualify for a reduced exclusion. Publication 523 covers what qualifies. Probably not your situation but good to know the escape hatch exists.

Can you actually get the exclusion if you converted to a rental and have a 1031 exchange in your history? There's a 5-year holding rule for homes acquired through a like-kind exchange that blocks the exclusion. Just making sure that's not in the picture for you.

Maya L.

Author

No 1031 exchange in my history — bought this outright as a primary residence. But that's good to flag for anyone else reading this thread.

Stepping back to the sell-or-wait framing: the exclusion does disappear on a single cliff date, once qualifying use days within the rolling 5-year window drop below 24 months. If you technically still have enough qualifying days to meet the 24-month threshold tomorrow but not in six months, then waiting six months makes you lose the exclusion entirely unless a workplace, health or unforeseeable-event partial exclusion applies — so even if timing the sale for a lower-income year could reduce the rate on whatever portion is taxable, weigh that against losing the exclusion.

This is a good point to think through. It is a binary cliff at the threshold — once you drop below 24 months of qualifying use in the window, you lose the exclusion unless the sale was mainly due to a workplace change, health issue or unforeseeable event.

Form 8949 reporting when you do sell: the sale goes in Part II (long-term, since you've owned it more than a year) with box F checked since it came on Form 1099-S. Code H and the excluded gain as a negative in column (g) for the excluded portion. The recapture piece flows separately through Form 4797 and is taxed as unrecaptured section 1250 gain at up to 25%, not on Form 8949.

Maya L.

Author

So I'll have entries on both Form 8949 and Form 4797 for the same sale. Good to know they serve different purposes and I shouldn't be trying to put the recapture on Schedule D.

The IRS topic page on capital gains and losses (Topic no. 409) and Publication 523 at irs.gov are both worth bookmarking for this. 523 especially has the step-by-step eligibility test and the worksheets for figuring the actual exclusion amount. The worksheets are actually usable if you go line by line.

Bottom line from this thread: check your exact move-out date against today to confirm you still have 24 months of main-home use inside the 5-year window, verify your post-move-out rental doesn't count as nonqualified use (it shouldn't per the exception), calculate adjusted basis using your depreciation schedule, run the exclusion against that gain, and then model the tax on recapture and any remaining gain. That's the full picture before you decide on timing.

Maya L.

Author

This is the checklist I needed. Going to pull my depreciation schedule and work through each step before I commit to a sale date.