How to Avoid Capital Gains Tax on Real Estate: Where Opportunity Zones Fit (Agent's Guide)
How to avoid capital gains tax on real estate, for agents: the home sale exclusion, 1031 exchanges, installment sales, and where an Opportunity Zone fund fits.
Clients ask agents about taxes before they ask anyone else, usually at the listing appointment. You are not their tax advisor, and you shouldn’t act like one. But you can know the main options well enough to say “here’s what to ask your CPA” and point them to tools that run their own numbers.
This guide covers the federal options in plain terms and shows where an Opportunity Zone fund fits. It is part of our series for agents; the full set of client conversations is in OZ talking points for your next listing appointment.
The four questions that sort every seller
Before any strategy, the answer depends on four facts. Ask them in this order:
- Is it a home they lived in, or an investment or business property? That decides whether the home sale exclusion applies.
- Roughly how much gain is there? Sale price minus adjusted basis (purchase price plus improvements, minus depreciation taken). Many homeowners have less taxable gain than they fear.
- Do they want to own real estate again? That decides whether a 1031 exchange is even on the table.
- When do they need the cash? Some options need the whole sale price reinvested; others only the gain.
Option 1: The home sale exclusion (primary residence)
A seller who owned the home and used it as a main home for at least two of the five years before the sale can generally exclude up to $250,000 of gain, or $500,000 for most married couples filing jointly (IRC §121; IRS Publication 523). There are partial exclusions for some moves and exceptions for periods the home was rented out, so the details belong with the CPA.
The full rules, including partial exclusions and rental periods, are in the Section 121 home sale exclusion. Second homes don’t qualify; see capital gains tax on a second home.
For most homeowners this is the whole answer. The other options matter when the gain is above the exclusion, or when the property is a rental, land, or a commercial building.
Option 2: A 1031 like-kind exchange (investment and business property)
A 1031 exchange defers the gain on real property held for investment or business use when the seller buys replacement real property. The replacement must be identified within 45 days and received within 180 days (or the return due date, if earlier), and the seller generally has to reinvest all the net proceeds and replace the debt to defer everything (IRC §1031; Treas. Reg. §1.1031(k)-1). A qualified intermediary has to hold the cash.
It works well for a client who wants to keep owning real estate. It works badly for a client who wants out, wants cash, or can’t find a replacement in 45 days. A primary residence doesn’t qualify.
Option 3: An Opportunity Zone fund (gain only, any timeline after the sale)
An Opportunity Zone investment defers an eligible capital gain when the seller invests the gain (not the whole sale price) in a qualified opportunity fund (QOF) within 180 days (IRC §1400Z-2). The fund, not the seller, buys and improves property in an Opportunity Zone. The seller does not have to buy property in a zone, and the property they are selling does not have to be in one.
Under the rules for investments made on or after January 1, 2027 (Public Law 119-21, §70421):
- The deferred gain is included after five years, less a 10% basis step-up (30% for a qualified rural fund).
- Appreciation on the fund investment can be excluded if it is held at least 10 years, with the election capped at 30 years.
The three benefits are explained with the numbers in our Opportunity Zone tax benefits guide. Investments made in 2026 fall under the older rules, where deferred gain is recognized December 31, 2026; the 180-day deadline calculator shows which side of that line a client’s gain lands on.
Where it fits for real estate sellers:
- Gain above the home sale exclusion. The excess is eligible capital gain.
- Investment property sellers who want out of landlording. They keep their basis and the loan payoff, and only the gain goes into the fund.
- Boot from a 1031 exchange, or a failed exchange. See can you 1031 into an Opportunity Zone?
What it does not do: it doesn’t make the original gain disappear, it doesn’t defer ordinary-income recapture under §1245, and it ties money up in an illiquid fund for years. The depreciation recapture calculator splits a rental sale into the deferrable and non-deferrable parts.
Option 4: Other tools the CPA may raise
- Installment sale. Spreading the payments over years spreads the gain (IRC §453). It doesn’t apply to recapture, which is taxed in the year of sale.
- Holding until death. Heirs generally get a basis equal to fair market value at death (IRC §1014), which is why some owners never sell.
- Offsetting losses. Capital losses from other investments offset capital gains.
These are planning conversations for the client’s CPA and estate attorney. Your job is to make sure the client has them before signing a listing agreement, not after closing.
Side by side
| Home sale exclusion | 1031 exchange | Opportunity Zone fund | |
|---|---|---|---|
| Property sold | Main home | Investment or business real property | Any asset with eligible capital gain |
| What gets reinvested | Nothing | All net proceeds, plus replace debt | Only the gain you want to defer |
| Deadline | None | 45 days to identify, 180 to close | 180 days to invest |
| Result | Gain up to the limit excluded | Gain deferred into the new property | Gain deferred 5 years (10% step-up); fund appreciation excludable after 10 years |
| What the client owns after | Nothing | Another property they manage | A fund interest someone else manages |
To compare a 1031, a DST and an Opportunity Zone fund on the client’s own numbers, use the 1031 vs DST vs Opportunity Zone calculator. The full rules comparison is in 1031 exchange vs Opportunity Zone.
What to say at the listing appointment
- “Before we price this, do you know roughly what your gain will be? Your CPA can pull your basis from your returns.”
- “If you lived here two of the last five years, a big part of the gain may already be excluded. Let’s confirm that with your CPA.”
- “If you want to buy another rental, a 1031 is worth a call to a qualified intermediary now, because the 45-day clock starts at closing.”
- “If you want out of real estate, there’s also the Opportunity Zone route. Only the gain is reinvested, and there’s a 180-day window after closing.”
If a client wants to look at funds, the Opportunity Zone funds directory lists funds with their SEC filings. We don’t recommend funds, and neither should you without a license to do so.
Related reading
- Opportunity Zones after selling real estate
- Is your listing in an Opportunity Zone?
- Capital gains tax on rental property
- Capital gains on inherited property
- OZ talking points for agents (series hub)
Sources: IRC §121; IRS Publication 523; IRC §1031; Treas. Reg. §1.1031(k)-1; IRC §1400Z-2; Treas. Reg. §1.1400Z2(a)-1; Public Law 119-21; IRC §453; IRC §1014.
Not tax advice.
Frequently asked questions
Can a seller avoid capital gains tax on the sale of a home?
Is a 1031 exchange or an Opportunity Zone fund better for an investment property seller?
Does an Opportunity Zone investment avoid capital gains tax completely?
Does the seller have to reinvest the whole sale price in an Opportunity Zone fund?
Can depreciation recapture go into an Opportunity Zone fund?
Get the OZ 2.0 Investor Guide
One email when major OZ 2.0 events happen — Treasury guidance, state filings, rule changes. Unsubscribe anytime.
Tools: 1031 vs DST vs Opportunity Zone calculator · 180-day rule calculator · Depreciation recapture calculator · all Opportunity Zone tools