Do I owe capital gains selling former home after renting it out?

Trying to figure out if I owe capital gains selling my former home after renting it out. I lived there from 2017 to 2021, then moved and started renting it to tenants. Sold it this past spring for a decent profit. I always assumed the home sale exclusion would protect me but my tax software is flagging it and asking questions about "period of non-qualified use" and depreciation recapture. I've never dealt with this before. I did receive a Form 1099-S at closing. I know there's some $250k exclusion thing for single filers but I'm not sure if the rental period messes that up. Do I still qualify for any exclusion, or am I looking at full capital gains on the whole profit?

34 comments

How long did you own the place total before the sale? And were you single the whole time or married at any point? Those two facts change the exclusion math a lot.

Naomi G.

Author

Owned it about 8 years total, single the whole time. So roughly 4 years living there, 4 years renting it out before I sold.

The main question is whether you meet the ownership and use tests. You need to have owned AND used it as your main home for at least 24 months out of the 5 years before the sale date. The 24 months don't have to be consecutive. With 4 years of living there before 2021 that sounds like you're well over the threshold, but only the last 5 years before sale count for the use test.

Naomi G.

Author

So my last 5 years before the sale would be roughly 2020 to 2025. I lived there through mid-2021, so that's maybe 18 months of personal use inside that window. Does that hurt me?

Yeah that's the issue. If only 18 months of your personal use falls inside the 5-year lookback, you may not hit the 24-month threshold. You'd want to count the exact dates carefully before filing.

This is exactly the trap people fall into when they rent out a place for a few years before selling. I went through something similar last year. I uploaded my closing disclosure and depreciation schedules to taxr.ai and it walked through each part of my gain calculation — the excluded portion, the non-qualified use period, and the depreciation recapture piece separately. Really helped me see which numbers went where on Form 8949 and Schedule D before I handed everything to my CPA. For the non-qualified use piece: only periods after 2008 when it wasn't your main home before you last lived there (like renting before you moved in) count, so rental after you moved out isn't non-qualified use, even though it can still make you fail the use test. That's the "period of non-qualified use" your software is asking about.

Naomi G.

Author

That's really helpful framing. So if I do qualify for the exclusion, the rental years after I moved out don't create a non-qualified use chunk, and only depreciation and the use test are what I need to watch?

Not quite. The non-qualified use fraction is basically: days of non-qualified use after 2008 divided by total days you owned it, but time after you last lived there as your main home isn't non-qualified use. That fraction of the total gain is excluded from the exclusion. The rest, if you meet the use test, can still be excluded up to the limit.

Don't forget depreciation recapture — that's a separate issue from capital gains. Any depreciation you claimed (or were allowed to claim) during the rental years gets recaptured at ordinary income rates, up to 25% for unrecaptured Section 1250 gain. That doesn't get wiped out by the home sale exclusion at all.

This is the part most people miss. The recapture is based on what you were "allowed or allowable" to deduct, so even if you forgot to take depreciation some years, the IRS still counts it.

Did you file Schedule E every year you rented it? Because the depreciation you claimed there is what determines the recapture number. I had a situation where my 1099-S came in and I wasn't sure how to reconcile all the depreciation years. Uploaded everything to Taxr and it listed out the cumulative depreciation from each Schedule E and showed me how that total fed into the unrecaptured Section 1250 gain line on Schedule D. Saved me from understating the recapture.

Naomi G.

Author

I did file Schedule E each year. I think I took depreciation every year. So I need to add up all those annual depreciation deductions to get the total recapture amount?

Exactly. Add up the depreciation claimed on all your Schedule E filings for the property. That total is your unrecaptured Section 1250 gain, taxed separately from the rest of your long-term capital gain.

Since you got a Form 1099-S, you have to report the sale on Form 8949 regardless of whether the gain is fully excluded. That's the rule — 1099-S triggers mandatory reporting even with zero taxable gain.

Naomi G.

Author

Good to know. So I can't just leave it off the return even if the exclusion covers most of it.

How you fill out Form 8949 matters here. The sale goes in Part II (long-term, since you owned it more than a year). You'd check box F, since the sale came on a Form 1099-S rather than a Form 1099-B. For a home sale with a 1099-S and an exclusion, you use code H in column (f) and enter the excluded gain as a negative number in column (g). The taxable portion stays in column (d) less column (e) plus column (g).

Worth adding that the depreciation recapture piece doesn't go on 8949 — that flows through Schedule D as unrecaptured Section 1250 gain and is calculated on the Unrecaptured Section 1250 Gain Worksheet in the Schedule D instructions.

What was your original purchase price and what did you spend on improvements? Your adjusted basis includes those capital improvements, which can lower your overall gain before you even get to the exclusion question.

Naomi G.

Author

I have records of a kitchen remodel and a new roof. So those get added to my basis and reduce the taxable gain?

Right, capital improvements add to basis under Publication 551. Regular repairs and maintenance don't. The adjusted basis then also gets reduced by cumulative depreciation claimed, which is why the depreciation recapture comes into play.

The holding period question is settled in your favor at least — securities rules have you count from day after acquisition to trade date of sale, but for real property you count from date after you got title to the closing date. Eight years is clearly long-term, so any taxable gain (outside the recapture) gets long-term rates.

Are you in a state with its own capital gains tax? Some states don't have the same exclusion rules as federal, and a few treat the depreciation recapture differently. Just making sure you're not only looking at the federal side.

Naomi G.

Author

Good point, I hadn't even started thinking about the state side. I'll need to check my state's rules separately.

Going back to the use test — the 24 months inside the 5-year window doesn't have to be continuous. Can you check the actual dates you moved out versus the sale date? Even a few extra months could push you over 24.

Naomi G.

Author

I moved out in June 2021 and sold in April 2025. So the 5-year window is April 2020 to April 2025. I was there from April 2020 to June 2021 — that's only about 14 or 15 months inside the window. So I'm under 24 months.

In that case you likely don't meet the use test and wouldn't qualify for the main exclusion. You may still want to check if any partial exclusion applies — the IRS allows that if the main reason for the sale was a job change, health reason or unforeseen event. Otherwise the full gain would be taxable (less the basis adjustments).

If you don't qualify for the exclusion at all, the entire gain is long-term capital gain, plus the depreciation recapture piece on top. That can be a meaningful number. At that point I'd strongly recommend sitting down with a CPA or enrolled agent rather than relying on software alone — the interaction between non-qualified use, partial exclusion eligibility, and recapture has a lot of moving parts.

I want to flag something: someone upthread implied that any rental period creates non-qualified use. That's not accurate for rental after the last date you used it as your home — that time isn't non-qualified use — but rental periods before you moved in do count as non-qualified use. Rental while you were living there doesn't. The IRS rules under section 121(b)(5) look at non-qualified use starting from January 1, 2009.

Right, rental after you move out isn't non-qualified use, and rental use before you first moved in does count against you, though that doesn't apply here since the poster lived there first.

Publication 523 on irs.gov has the full eligibility test, the partial exclusion rules, and a worksheet for figuring the gain and loss. If you're doing this yourself, that's the place to start before touching the software.

Naomi G.

Author

Went back through it last night. The worksheet on figuring the gain makes it clearer. I think my situation lands at no full exclusion, some depreciation recapture, and a fully taxable long-term gain on the rest. Going to get a CPA involved given the numbers.

One thing that tripped me up in a similar situation: make sure your basis calculation starts from your original purchase price plus closing costs at acquisition, not just the purchase price. Those original closing costs that were capitalized are easy to forget when years have passed.

Where you end up depends on a few facts still open: (1) exact move-out and sale dates to confirm the use test, (2) total depreciation from all Schedule E filings, (3) capital improvements with documentation, (4) whether any partial exclusion exception applies, and (5) state tax rules. The federal Form 8949 and Schedule D are the landing places, with the unrecaptured Section 1250 gain worksheet inside the Schedule D instructions handling the recapture piece.

Naomi G.

Author

This is a solid checklist. Pulling all those documents together this week before I meet with a CPA. Really appreciate everyone working through this — it's more complicated than I thought but at least I know what I'm looking at now.