1031 Exchange Primary Residence
Start with the facts

Avoiding Capital Gains on Real Estate

How homeowners legally reduce taxable gain on a home sale using adjusted basis, capital improvements, selling costs, and the Section 121 exclusion.

What this property or sale question changes

Most people who sell the home they live in do not owe federal tax on the sale, and the reason is not a rollover into another property. It is ordinary math: adjusted basis, selling costs, and the Section 121 exclusion, applied in the right order, absorb most of the gain before a tax rate ever enters the picture.

Adjusted basis starts with what was paid for the home, then adds documented capital improvements and subtracts any depreciation claimed if part of the home was ever rented. Selling costs come off the amount realized. What is left after those two steps is the gain, and for an owner who lived in the home two of the last five years, up to $250,000 of that gain is excluded from federal tax, or $500,000 for a married couple filing jointly.

The math does not work the same way for every seller. A home held for decades in an appreciating market, a second home, or a property with a rental history can produce gain above the exclusion. Those cases call for a closer look at basis records, depreciation recapture, and whether any part of the property was genuinely converted to investment use.

Start With Adjusted Basis, Not the Sale Price

Gain is not the sale price. It is the sale price, less selling costs, minus adjusted basis. Adjusted basis begins with the original purchase price plus settlement costs paid at closing, then adds the cost of capital improvements made during ownership: a new roof, a room addition, replacement windows, a finished basement, a new HVAC system.

Repairs and routine maintenance do not count. Painting a room, fixing a leaking faucet, or replacing a broken window pane keeps the house in its existing condition and does not add to basis. The distinction matters because misclassifying a maintenance expense as an improvement inflates basis and understates gain, which is the kind of error an IRS review catches quickly if the return is examined.

Keeping receipts, contractor invoices, and permits for every improvement made over the years of ownership is the single most useful thing a homeowner can do before selling. Without records, a seller is left estimating, and estimates favor the government, not the taxpayer.

Selling Costs Reduce the Taxable Gain Too

The amount realized on a sale is not the contract price. It is the contract price minus real estate commissions, title insurance premiums paid by the seller, transfer taxes, attorney fees, and other costs directly tied to closing the transaction. Staging costs and some pre-sale repairs negotiated as part of the deal can sometimes be added here as well, depending on how they were structured in the contract.

On a $700,000 sale with a 5 percent commission and $8,000 in other closing costs, roughly $43,000 comes off the top before gain is calculated. That is not a deduction taken on a tax return line; it reduces the amount realized directly, which lowers the gain that Section 121 and any remaining tax rate apply to.

The Section 121 Exclusion and Its Limits

Section 121 lets a homeowner exclude up to $250,000 of gain from federal tax, or $500,000 on a joint return, if the ownership and use tests are met: the home was owned and used as the seller's main residence for at least two of the five years before the sale. The exclusion can generally be used once every two years, not on every sale.

The exclusion has a carve-out for depreciation. If part of the home was rented at any point after May 6, 1997, and depreciation was claimed on that portion, the exclusion does not cover the amount of depreciation taken. That portion is taxed separately as unrecaptured Section 1250 gain, capped at a 25 percent rate, regardless of how much of the rest of the gain the exclusion shelters.

Partial exclusions are available for sellers who do not meet the full two-year test because of a job change, health condition, or other unforeseen circumstance specified in the regulations. The partial exclusion is prorated based on the portion of the two-year period actually met, not a flat reduction.

When the Numbers Still Leave Taxable Gain

In long-held properties or fast-appreciating markets, gain can exceed the exclusion even after basis adjustments and selling costs are applied. A home purchased for $180,000 in 1998 and sold today for $950,000, with $60,000 in documented improvements, produces gain well above the $250,000 single-filer exclusion once selling costs are netted out.

Sellers in this position sometimes ask whether a like-kind exchange can defer the gain the way it would on an investment property. It cannot, not for a property that has functioned as a personal residence. Installment sale treatment under Section 453, spreading the gain over multiple tax years as payments are received, is one option worth reviewing with a preparer in that situation.

Why a Straight Rollover Into a New Home Does Not Exist

Before 1997, the tax code allowed a homeowner to defer gain by rolling proceeds into a replacement residence of equal or greater value. That provision was repealed and replaced by the Section 121 exclusion, which does not require buying another home at all. There is no current mechanism to defer gain on a personal residence by purchasing a new one.

Section 1031 exchange treatment is reserved for property held for investment or business use. A primary residence does not qualify, even if the owner intends to buy another primary residence with the proceeds. The only path toward exchange-eligible treatment runs through a genuine, sustained conversion of the property to rental use, documented with a lease, reported rental income, and depreciation claimed on a tax return, well before a sale is contemplated.

What to clarify before acting on Avoiding Capital Gains on Real Estate

How homeowners legally reduce taxable gain on a home sale using adjusted basis, capital improvements, selling costs, and the Section 121 exclusion. The practical review should begin before the property is listed or the closing calendar begins to control the available choices. An early review gives the owner time to correct missing records, compare a taxable sale with exchange treatment, define replacement criteria, and bring the right professionals into the transaction.

Gather ownership records, move-in and move-out dates, leases, rental income, personal-use days, improvement receipts, depreciation schedules, debt, and the expected sale date. Those records turn a broad question into a supportable property-use timeline and an actual estimate of sale proceeds. They also expose issues that generic calculators miss, including periods of mixed use, depreciation that must be accounted for, ownership changes, debt replacement, co-owner differences, and expenses that change adjusted basis.

The central decision is whether the property’s documented use supports investment treatment, whether Section 121 may cover part of the gain, and whether continued real-estate ownership still fits the owner’s life after closing. The result should be a written set of priorities for the sale: the amount of liquidity needed, the income expected from replacement property, the level of control the owner wants, the management work the owner is willing to keep, and the risks that require additional diligence.

Use the 45-day window for decisions, not discovery.

When a 1031 exchange remains a viable path, define the acquisition brief before the relinquished property closes. Primary and backup candidates should be compared for price, debt, income, control, workload, inspections, insurance, financing, title, sponsor or tenant exposure, and the probability of closing on time. Waiting until identification begins often turns a deliberate strategy into a search for whatever happens to be available.

If a portion of the home was genuinely converted to rental use for long enough to qualify as investment property, that portion, and only that portion, can later be exchanged into a DST allocation as part of a documented 1031 transaction. Projected income is not guaranteed, private offerings can be illiquid, and sponsor-controlled investments require a complete review of offering documents, fees, conflicts, leverage, property risks, investor eligibility, and suitability through an appropriately licensed professional.

The next useful conversation connects this topic with the rest of the sale. Related questions may include the Section 121 home sale exclusion in detail, selling a home without paying capital gains tax, the partial exclusion for unforeseen circumstances. Addressing those questions together helps the owner avoid solving one tax issue while creating an ownership, income, financing, or liquidity problem after closing.

Common questions

Frequently Asked Questions

Does buying a more expensive home defer the tax on my current home's gain?

No. That rollover rule was repealed in 1997. The current mechanism is the Section 121 exclusion, which applies whether or not you buy another home.

Can I use the Section 121 exclusion if I rented out a room in my home?

Generally yes for the personal-use portion, but any depreciation claimed on the rented portion is excluded from the Section 121 shelter and taxed separately as unrecaptured Section 1250 gain.

What records do I need to prove my adjusted basis?

Keep the original purchase settlement statement, contractor invoices and permits for capital improvements, and any documentation of depreciation claimed if part of the home was rented.

Is a new roof a repair or a capital improvement?

A new roof is a capital improvement and adds to basis. Patching a section of an existing roof is a repair and does not.

Can I do a 1031 exchange on the home I currently live in?

No. A primary residence does not qualify for a 1031 exchange. That treatment applies only to property held for investment or business use, which generally requires a documented rental conversion first.