Can you avoid capital gains tax on LLC rental sale by building primary residence on the property?

Trying to figure out if there's a real path here. I own a rental property through a single-member LLC. The LLC bought raw land a few years back, built a rental unit on it, and that unit has been generating rental income. Now I'm thinking about tearing down the rental and building a new home to live in as my primary residence, then eventually selling. The idea is to avoid capital gains tax on LLC rental sale by building primary residence on the land and using the home sale exclusion. I've been reading Publication 523 at irs.gov and understand there's an ownership and use test, but I'm not sure how the LLC ownership layer affects the exclusion, how depreciation recapture fits in, or how long I'd need to actually live there. Has anyone actually done something like this or know what the real issues are?

35 comments

Publication 523 is the right starting point but it only tells part of the story here. The home sale exclusion requires you to have owned and used the home as your main residence for at least 24 months out of the 5 years before the sale. The clock on use doesn't start until you're actually living there as your primary home, not when construction finishes.

Tara A.

Author

Right, so if I move in when the build is done, I'd need to actually live there 2 full years before selling to get the full exclusion. That part I think I understand. It's the LLC layer and the depreciation piece that are tripping me up.

The LLC structure is probably the first thing to sort out. If it's a single-member LLC disregarded for federal tax purposes, the IRS treats you as directly owning the property, which matters for both the ownership test and how gains are calculated. But if the LLC ever elected to be taxed as a corporation, the exclusion is gone entirely because a corporation can't use the section 121 exclusion.

Tara A.

Author

It's a disregarded entity, single-member, never elected corporate status. So for federal purposes I think the ownership and use tests look at me directly, not the LLC as a separate taxpayer. That's a relief at least.

Disregarded status is key. Worth confirming with an enrolled agent anyway given the LLC layer, but yeah the IRS looks through it for income tax.

Depreciation recapture is what surprised me most when I went through something similar. Even if you qualify for the section 121 exclusion on the gain from appreciation, the gain equal to the depreciation you claimed on the rental can't be excluded. With straight-line depreciation on a residential rental it isn't ordinary income; it's unrecaptured section 1250 gain taxed at a maximum 25% rate, and that piece does not get excluded. I uploaded my depreciation schedules and sale documents to taxr.ai and had Taxr estimate how much of the total gain would be recaptured versus how much could potentially be sheltered. That breakdown changed how I thought about the timeline.

Tara A.

Author

Okay, the depreciation angle hadn't really sunk in for me until now. So even if I meet the 2-of-5 use test, the depreciation I took on the rental unit would still come back as recapture regardless of the exclusion?

Exactly. The exclusion shelters the gain from appreciation but section 1250 unrecaptured gain sits outside it. The IRS is explicit that the exclusion under section 121 doesn't cover depreciation recapture. Check Publication 523, the section on depreciation, it spells it out.

There's also the question of what happens to the rental unit's adjusted basis. If you demolish the existing structure to build the new home, you can't just carry forward the old rental's depreciated basis into the new home. The demolition loss treatment and how the new home's basis is established matters for figuring the eventual gain.

Publication 551 on basis of assets covers some of this. The cost of demolition plus the undepreciated basis of the old structure generally gets added to the land, not deducted currently.

Tara A.

Author

So the demolition cost and remaining basis of the old rental roll into land basis, and then the new construction costs build the home's basis from there. That actually could help the gain calculation on the eventual sale.

Section 1031 exchange is sometimes floated as an alternative here but once you convert to a primary residence that path gets more complicated. There's also a 5-year holding requirement now for property acquired through a 1031 exchange before the section 121 exclusion can apply. Just flagging it in case that came up in your reading.

Tara A.

Author

I've seen that mentioned. I'm not planning a 1031, just the straight conversion from rental to primary. But good to know that route has its own clock.

Form 4797 is going to be part of the picture when you eventually sell. Any section 1250 recapture gets reported there, and the interaction with Schedule D for the remaining gain is where things can get complicated. The instructions for Form 4797 walk through the recapture calculation.

The real work is getting the adjusted basis right long before the sale ever lands on Schedule D and Form 8949. I had Taxr go through my prior-year depreciation records and the asset detail from my tax software to build a running adjusted basis figure. It listed every year's depreciation claimed and flagged where the numbers in my software didn't match what was on the actual returns. Useful before talking to a CPA about the conversion strategy.

Tara A.

Author

That kind of basis reconciliation is exactly what I'd need. I have about 4 years of depreciation on the rental and I'm honestly not confident my records are clean.

Four years of depreciation schedules can drift if you ever changed software or had a preparer use different asset groupings. Worth getting that reconciled early.

The 2-of-5 use test has a nuance worth mentioning: the 24 months don't have to be consecutive. But they do have to be within the 5-year window ending on the sale date. So if you move in, then travel or rent a room, you're not necessarily disqualified but you need to track the days carefully.

Tara A.

Author

Good to know the months don't have to be consecutive. I'd be living there full time so it shouldn't be an issue but I'll keep records just in case.

One thing that often gets overlooked: the period the property was used as rental after December 31, 2008 is what matters for the nonqualified use rules. Gain allocated to periods of nonqualified use does not qualify for the exclusion. So the years the property sat as a rental before you converted it contribute to the nonqualified use fraction.

Tara A.

Author

Wait — so even after I meet the 2-of-5 test, a portion of the gain gets allocated to the rental years and isn't excludable? I need to read more on this.

Publication 523 has the nonqualified use section. The fraction is roughly the period of nonqualified use divided by the total ownership period. It's not all-or-nothing.

This is the piece most people miss. They assume meeting the use test means the whole gain is excluded and that's not right once you've had rental use.

State taxes are a separate layer too. Some states don't conform to the federal section 121 exclusion fully, or they have their own depreciation recapture rules. The federal answer might look good and the state bill still hurts.

California for example has its own treatment and doesn't always follow federal on these. Definitely worth a state-specific look wherever the property is located.

Form 6252 is worth knowing about if you ever considered an installment sale on the eventual exit, though that doesn't eliminate recapture either. Only section 1245/1250 ordinary-income recapture has to be recognized in full in the year of sale. Unrecaptured section 1250 gain from straight-line depreciation on a rental can be reported as the installment payments come in, and it is still taxed at up to 25%. I ran my sale scenario documents through Taxr and it laid out which portions of the gain would be recaptured in year one versus which could potentially be spread, which helped me have a much more specific conversation with my enrolled agent.

Tara A.

Author

Installment sale wasn't on my radar but good to know the 25% depreciation piece can still be spread over the installment payments rather than all hitting in year one. That would change the cash flow math significantly.

To figure your eventual gain you'll need: original purchase price of land, all construction costs for the rental (minus accumulated depreciation to get adjusted basis), demolition costs, new home construction costs, any capital improvements, and then the sale price minus selling costs. Each piece feeds into Schedule D and Form 4797 differently.

Tara A.

Author

This is a good checklist. I have most of the construction records but I should pull everything together now rather than scrambling at sale time.

The allocation between land and structure at original purchase also matters. If the original appraisal broke those out, hold onto it.

A CPA or enrolled agent who handles real estate conversions specifically is worth the cost here. The nonqualified use fraction, the recapture calculation, basis tracking through demolition and reconstruction — these interact in ways that are hard to get right without someone who's done it before.

Tara A.

Author

Agreed. I wanted to understand the mechanics before I sat down with someone so I wasn't starting from zero. This thread has helped a lot with that.

Topic no. 409 at irs.gov also covers the capital gains and losses framework and links to the holding period rules. The holding period on the new home starts fresh from when you acquire or complete it, not from when you bought the original land, at least for the structure — though land ownership continuity may matter differently.

Publication 550 chapter 4 has the holding period rules in detail. Worth reading alongside Publication 523 since the two interact when you've had the property in multiple use categories over the years.

Tara A.

Author

I'll read both. At this point my to-do list is: reconcile depreciation records, get a basis schedule together from land purchase through today, then meet with an enrolled agent who does real estate conversions. The nonqualified use fraction is probably where the most tax is hiding.