You can legally avoid, defer, or reduce capital gains tax on rental property in several ways: a 1031 like-kind exchange defers the tax when you roll proceeds into another investment property; moving in and using the home as your primary residence for two of the five years before sale can exclude up to $250,000 (or $500,000 for a married couple filing jointly); an installment sale spreads the gain across years; a Qualified Opportunity Fund investment defers and can partially reduce the gain; loss harvesting and released passive losses offset it; and holding until death eliminates the built-up gain entirely through a stepped-up basis for your heirs. Which one fits depends on your timing, your income, and what you plan to do with the money.
Before choosing, know what you’re up against. Held more than a year, your profit is taxed at the long-term capital gains rate of 0%, 15%, or 20% depending on income.1Internal Revenue Service. Topic No. 409, Capital Gains and Losses Held a year or less, the gain is ordinary income, up to 37% in 2026.2Internal Revenue Service. IRS Releases Tax Inflation Adjustments for Tax Year 2026 On top of that, the depreciation you claimed (or could have claimed) during the rental years is recaptured at up to 25%. And if your modified adjusted gross income exceeds $200,000 single or $250,000 joint, a 3.8% net investment income tax hits your gain as well.3Office of the Law Revision Counsel. 26 U.S.C. 1411 – Imposition of Tax A high-income seller can face a combined federal rate above 40% on parts of the sale, which is why the strategies below are worth the trouble.
Defer the Tax With a 1031 Exchange
A like-kind exchange defers the entire capital gain, including depreciation recapture, when you reinvest the proceeds into another investment property. Real estate held for business or investment qualifies broadly: you can trade a rental house for farmland, or an apartment building for a retail storefront. Personal residences and property held primarily for resale are out.4Office of the Law Revision Counsel. 26 U.S.C. 1031 – Exchange of Real Property Held for Productive Use or Investment
The rules are unforgiving. You cannot touch the sale proceeds. A qualified intermediary holds the funds between closings; taking direct control of the money, even briefly, blows the exchange and makes the whole gain taxable.5Internal Revenue Service. Instructions for Form 8824 You must identify replacement properties in writing within 45 days of the sale, and the exchange must close within 180 days of the sale or by your tax return due date with extensions, whichever comes first.4Office of the Law Revision Counsel. 26 U.S.C. 1031 – Exchange of Real Property Held for Productive Use or Investment Miss either date and the deferral is gone.
To defer everything, the replacement property must be equal or greater in value and you must reinvest all of the proceeds. Any shortfall, cash received, or debt relief is called boot, and it is taxable in the year of the exchange. Sell for $500,000 and reinvest $450,000, and that $50,000 is a taxable gain now.
Move In and Use the Section 121 Exclusion
If you sell a home you used as your primary residence for at least two of the five years before the sale, you can exclude up to $250,000 of gain, or $500,000 if you’re married filing jointly.6Office of the Law Revision Counsel. 26 U.S.C. 121 – Exclusion of Gain From Sale of Principal Residence The two years don’t have to be consecutive; they just have to add up to 24 months within the five-year window.7eCFR. 26 CFR 1.121-1 – Exclusion of Gain From Sale or Exchange of a Principal Residence Some owners move into a rental specifically to reach that threshold.
Two catches limit the strategy. Any period after January 1, 2009, when the property was not your primary residence counts as “nonqualified use.” You divide that nonqualified use period by your total ownership period, and that fraction of the gain stays taxable. Own for ten years, rent for eight, live in for two: only 20% of the gain is eligible for exclusion. And if you originally acquired the property through a 1031 exchange, you cannot claim the Section 121 exclusion during the first five years after the exchange.8Office of the Law Revision Counsel. 26 U.S.C. 121 – Exclusion of Gain From Sale of Principal Residence
One more boundary. The exclusion never covers depreciation. Any depreciation claimed while the property was a rental is still subject to the 25% recapture tax, even if the rest of the gain is excluded.
Spread the Gain Through an Installment Sale
An installment sale structures the deal so the buyer pays you over several years. You report only the portion of gain you actually collect each year rather than the whole profit at once.9Internal Revenue Service. Topic No. 705, Installment Sales Keeping your annual income lower can drop you into a lower capital gains bracket and reduce your exposure to the 3.8% net investment income tax.
You report the sale on Form 6252 in the year of sale and each year you receive a payment, and any interest the buyer pays is ordinary income to you. You can also elect out of installment treatment and pay the tax up front, but the election must be made by the due date of the return, including extensions, for the year of sale.9Internal Revenue Service. Topic No. 705, Installment Sales Depreciation recapture is the exception: it has to be reported in full in the year of sale, no matter how long the payments run.
Roll Gains Into a Qualified Opportunity Fund
Investing your gain into a Qualified Opportunity Fund within 180 days of the sale defers the tax, and holding the QOF investment for at least ten years makes any appreciation inside the fund tax-free through a basis adjustment to fair market value at exit.10Internal Revenue Service. 11U.S. Department of Housing and Urban Development. Opportunity Zones Investors The tax-free treatment applies only to growth inside the fund, not to the original deferred gain.
The timing matters right now. Under the original program, deferred gains must be recognized by December 31, 2026, and the earlier basis step-ups have expired. A new version enacted through the One Big Beautiful Bill Act on July 4, 2025 applies to investments made on or after January 1, 2027. It restores a 10% basis step-up on the original deferred gain after five years, and a 30% step-up for investments in rural opportunity zones through a Qualified Rural Opportunity Fund.12U.S. Department of Housing and Urban Development. Opportunity Zones Updates
Offset the Gain With Losses You Already Have
Selling underwater investments in the same year you sell the rental offsets the gain dollar for dollar. If total losses exceed total gains, you can deduct up to $3,000 of the excess against ordinary income ($1,500 if married filing separately) and carry the rest forward indefinitely.1Internal Revenue Service. Topic No. 409, Capital Gains and Losses
Rental owners have a second, often larger, source of offsets. Rental activity is generally passive, and losses that exceed your passive income each year are suspended and carried forward.13Internal Revenue Service. Topic No. 425, Passive Activities – Losses and Credits When you sell your entire interest in the property, every previously suspended loss becomes fully deductible.14Office of the Law Revision Counsel. 26 U.S.C. 469 – Passive Activity Losses and Credits Limited Years of disallowed losses released at once can meaningfully cut the taxable gain in the year of sale.
Raise Your Basis Before You Calculate the Gain
Your taxable gain is the sale price minus your adjusted basis, so anything that lifts basis lowers tax. Start with the purchase price and the acquisition closing costs: title insurance, recording fees, legal fees. Then add every capital improvement made during ownership. Capital improvements add value, extend useful life, or adapt the property to a new use, and they are distinct from routine repairs. Common examples:
- Structural additions such as a bedroom, bathroom, deck, or garage.
- Major system replacements such as a new roof, HVAC system, plumbing, or electrical wiring.
- Permanent landscaping such as retaining walls, built-in irrigation, or driveways.
Selling costs come off the top as well. Real estate agent commissions, advertising, legal fees, and transfer taxes reduce the taxable gain.15Internal Revenue Service. Publication 523, Selling Your Home On a $500,000 sale with a 5% commission, that’s $25,000 shaved off before the gain is even calculated.
One trap to know. Depreciation reduces your adjusted basis each year, and the IRS uses depreciation “allowed or allowable,” meaning the reduction applies whether you actually claimed it or not.16Internal Revenue Service. Instructions for Form 4797 Skipping depreciation during ownership doesn’t save you from recapture; it just wastes the deduction.
Hold It Until Death
If you never sell, your heirs may owe nothing on the built-up gain. When someone inherits property, its basis resets to fair market value on the date of death.17Office of the Law Revision Counsel. 26 U.S.C. 1014 – Basis of Property Acquired From a Decedent All the appreciation and all the accumulated depreciation effectively vanish for income tax purposes. Buy for $200,000, die owning it at $700,000, and an heir who sells for $710,000 owes tax on $10,000, not $500,000. It’s not something you actively execute, but it belongs in the calculation when you’re weighing whether to sell now or hold.
Forms You’ll File at Sale
Whichever strategy you use, the paperwork is specific. Keep the settlement statement from your purchase, invoices for every improvement, and depreciation schedules from each year’s return. Then, at sale:
- Form 8949 reports each capital asset sale (dates, proceeds, basis) and feeds into Schedule D.18Internal Revenue Service. Instructions for Form 8949
- Schedule D (Form 1040) totals your capital gains and losses for the year.19Internal Revenue Service. Instructions for Schedule D (Form 1040)
- Form 4797 reports the sale of business property and calculates depreciation recapture.16Internal Revenue Service. Instructions for Form 4797
- Form 8824 is required for a 1031 exchange.5Internal Revenue Service. Instructions for Form 8824
- Form 6252 reports installment sale income in the year of sale and each year you receive a payment.9Internal Revenue Service. Topic No. 705, Installment Sales