Strategy

How to Avoid Capital Gains Tax When Selling a Rental Property: 7 Legal Ways

There is no legal way to sell a rental for cash, pocket the cash, and owe nothing. But there are seven legitimate ways to defer the tax, shrink it, or erase it entirely. I've ranked them by how much tax they handle and how many sellers can actually use them.

9 min read·Updated September 2026·By Leah Badach, CES
Key takeaways

1. The 1031 exchange (defers everything)

Sell the rental, have a qualified intermediary hold the proceeds, identify replacement investment property within 45 days, close within 180, and every tax layer defers: federal gain, depreciation recapture, the 3.8% NIIT, and state tax. There is no cap on the gain and no limit on how many times you can do it. Full mechanics in the 1031 exchange guide.

Who it fits: anyone who wants to stay in real estate. Who it doesn't: someone who needs the cash in hand. The intermediary must be engaged before closing.

2. Move in and use the Section 121 exclusion (partial)

Live in the property as your principal residence for two of the five years before sale and IRC §121 excludes up to $250,000 of gain ($500,000 married filing jointly). Three limits: rental use after 2008 is 'non-qualified use' that prorates the exclusion down, depreciation claimed after May 1997 is never excluded (it's still recaptured at 25%), and property you acquired through a 1031 must be owned five years before §121 applies. The math is in moving into your rental to avoid capital gains.

3. Installment sale (spreads it out)

Carry back a note for part of the price and, under IRC §453, you recognize gain only as principal payments arrive. That can keep you in the 15% bracket instead of 20% and pushes NIIT exposure across years. The 25% depreciation portion comes out of the first payments, interest income is ordinary, and you carry the buyer's credit risk. Compared side by side in installment sale vs 1031 exchange.

4. Qualified opportunity zone fund (defers the gain only)

Invest just the gain into a qualified opportunity fund within 180 days of sale and the tax on that gain is deferred until you sell the fund interest or December 31, 2026 (with rolling deferral windows for investments made after 2026 under the 2025 tax law). Hold ten years and appreciation on the fund itself is tax-free. You keep the original basis as cash. It is a bet on a specific fund and a specific zone. Comparison: 1031 vs opportunity zone.

5. Exchange into a Delaware Statutory Trust (1031 without landlording)

A DST is institutional real estate packaged so a fractional interest qualifies as 1031 replacement property (Rev. Rul. 2004-86). You get the full deferral of option 1 without tenants, toilets, or a 45-day scramble. The DSTs I work with are zero-cash-flow structures: there are no monthly distributions; the return is the tax you didn't pay, debt paydown, and your share of value at exit. It's a fit for investors who are done managing and a common day-44 backup identification.

6. Hold until death (eliminates it)

Under IRC §1014, heirs receive property at its fair market value on the date of death. Every dollar of deferred gain and recapture disappears for income-tax purposes. Combined with serial 1031 exchanges, this is the strategy practitioners call 'swap till you drop.' It works for very large gains and requires the property to still be in the estate. Details: what happens to a 1031 when you die.

7. Offset with losses (reduces it)

Capital losses from stocks or other property sales offset capital gains dollar for dollar, and suspended passive losses from the rental itself are released in full in the year you sell it in a taxable sale (IRC §469(g)). If you've been carrying years of passive losses you couldn't use, a taxable sale may hurt less than you think. Ask your CPA to pull your Form 8582 carryforward before you decide between a taxable sale and an exchange.

What doesn't work

Gifting the property to a child does not avoid the gain; they take your basis. Selling to your own LLC is a related-party transaction with no tax benefit. Paying off your primary-residence mortgage with the proceeds is a use of cash, not a deduction. And 'reinvesting' the money yourself without an intermediary is a fully taxable sale followed by an unrelated purchase. The order of operations, especially engaging a QI before closing, is what makes the difference.

Frequently asked questions

Can I avoid capital gains tax by reinvesting in another rental?

Only through a 1031 exchange, where a qualified intermediary holds the proceeds and you follow the 45-day and 180-day rules. Simply buying another property after a taxable sale does not defer anything.

How long do I have to live in a rental to avoid capital gains?

Two of the last five years as your principal residence for the Section 121 exclusion. But rental years after 2008 reduce the exclusion proportionally, and depreciation recapture is never excluded.

Is there an age exemption for capital gains on a rental property?

No. The one-time over-55 exclusion was repealed in 1997. Today the only age-related benefit is indirect: holding property until death gives heirs a stepped-up basis.

Can I use both a 1031 exchange and the Section 121 exclusion?

Yes, on mixed-use or converted property. Rev. Proc. 2005-14 lets you apply Section 121 to the residence gain and Section 1031 to the rest, including all depreciation recapture.


Not sure which of the seven fits you?

Tell me the property, the gain, and what you want the money to do next. I'll tell you which strategy actually applies.

See If I Qualify