You can reduce or eliminate capital gains tax before the 2-year rule kicks in by claiming a partial Section 121 exclusion if you sold for a qualifying reason, and by using basis adjustments, offsetting losses, installment reporting, a like-kind exchange, or a Qualified Opportunity Fund to shrink or defer whatever gain remains. Which combination fits depends on why you sold, how long you owned the property, and what you plan to do with the money.
What Selling Early Actually Costs
The standard exclusion under Section 121 wipes out up to $250,000 of gain on a primary residence, or $500,000 for a married couple filing jointly, but only if you owned and lived in the home for at least two of the five years before the sale.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence Fall short of 24 months and you lose the full exclusion.
What you owe on the unsheltered gain depends on how long you held the property. Anything held one year or less is taxed at ordinary income rates, which run from 10 percent to 37 percent. Held longer than a year, the gain qualifies for long-term rates of 0, 15, or 20 percent based on your taxable income.2Internal Revenue Service. Topic No. 409, Capital Gains and Losses Most states then tax the gain again as ordinary income, adding anywhere from nothing to over 13 percent depending on where you live.
The Partial Exclusion for Early Sales
The most direct relief comes from a partial exclusion, which is available if the sale falls into one of three IRS categories. You do not file a special application; you claim it on your return and keep records in case the IRS asks.3Internal Revenue Service. Publication 523 (2025), Selling Your Home
A Job-Related Move
You qualify if you started a new job, or were transferred, to a location at least 50 miles farther from your home than your prior workplace was. If your old office was 15 miles away and the new one is 65, the threshold is met. Taking a job in a distant city after a stretch of unemployment also counts.
A Health-Related Move
Moves to obtain medical treatment, to care for a sick family member, or to follow a doctor’s recommendation to change your living environment all qualify. The health issue does not have to be yours. A sale prompted by a parent’s or child’s care needs still opens the door to the partial exclusion.
Unforeseen Circumstances
This is the broadest category, and the IRS lists several named events:
- Divorce or legal separation.
- Death of an owner or resident.
- Job loss that leaves you unable to cover basic living expenses.
- Multiple births from one pregnancy that make the home too small.
- Natural disaster, casualty, or government condemnation of the property.
Even if none of the named events fits, you can still qualify by showing the primary reason for the sale was something you could not reasonably have anticipated when you bought the home, that it arose while you lived there, and that you sold not long after it happened.3Internal Revenue Service. Publication 523 (2025), Selling Your Home
Running the Numbers on a Partial Exclusion
The formula is simple. Take the shorter of the time you owned the home or the time you lived in it, divide by 24 months, and multiply by $250,000 (or $500,000 if married filing jointly).
A single homeowner who lived in the property 15 months before a qualifying job transfer could exclude 15/24 of $250,000, which is about $156,250. A married couple calculates each spouse’s exclusion separately based on individual qualifying periods, then adds them. If both spouses lived there the full 15 months, the combined exclusion is roughly $312,500.
One catch: if you already used a Section 121 exclusion on a different home sale within the previous two years, the qualifying period is measured from the date of that prior exclusion rather than from the date you moved into the current home.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence
Proving the Qualifying Event
Gather documents that show both the event and the timing. A job-related move calls for an offer letter or transfer notice with the new work location. A health move is best supported by a written recommendation from your doctor. Unforeseen circumstances are proven by whatever the event itself produced: a divorce decree, death certificate, unemployment determination, or casualty loss records.
Separately, document your exact ownership and occupancy dates. Utility bills, voter registration, and mail forwarding confirmations help establish when you moved in and out. The IRS looks at whether the sale followed the qualifying event closely and whether you could reasonably have foreseen the event when you bought.3Internal Revenue Service. Publication 523 (2025), Selling Your Home
Shrinking the Gain Through Cost Basis
Your taxable gain is the sale price minus your adjusted cost basis, not simply minus what you paid. Every dollar you add to basis is a dollar of gain that disappears, and this matters most when the exclusion covers only part of the profit or none at all.
Closing Costs From When You Bought
Several settlement fees from your original purchase add to basis: title search and title insurance, recording fees, transfer taxes, survey fees, and legal fees tied to obtaining title.4Internal Revenue Service. Publication 523, Selling Your Home They are on your original closing disclosure, and many sellers forget to include them.
Capital Improvements
Improvements that add value, extend the home’s useful life, or adapt it to a new use all increase basis. Adding a deck, replacing a roof, installing central air, remodeling a kitchen, or finishing a basement qualify. Routine repairs such as painting, patching drywall, or fixing a leaky faucet do not, unless they were part of a larger remodel.4Internal Revenue Service. Publication 523, Selling Your Home Keep receipts and contractor invoices. Without proof of the spending, the adjustment is not available.
Offsetting the Gain With Capital Losses
If you hold investments trading below what you paid, selling them in the same tax year as the home sale lets those losses cancel gain dollar for dollar. A $60,000 gain paired with $60,000 of losses produces zero net gain for the year.
If losses exceed gains, you can deduct up to $3,000 of the excess against ordinary income, or $1,500 if married filing separately.5Office of the Law Revision Counsel. 26 USC 1211 – Limitation on Capital Losses Unused losses carry forward to future years indefinitely.6Office of the Law Revision Counsel. 26 USC 1212 – Capital Loss Carrybacks and Carryovers
Watch the wash-sale rule if you are selling stocks or securities: buying back the same or a substantially identical security within 30 days before or after the loss sale disallows the loss.7Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities The rule does not apply to real estate.
Spreading the Tax Through an Installment Sale
If your buyer pays you over multiple years, the installment method lets you report gain as payments arrive instead of all at once. It applies automatically to qualifying sales unless you elect out.8Office of the Law Revision Counsel. 26 USC 453 – Installment Method
Each payment carries a proportional share of gain, basis recovery, and interest. Spreading the income across years can keep you in a lower bracket each year and may help you avoid the 20 percent long-term rate or the net investment income tax. The method is not available to dealers who sell property as inventory, but it works for one-off sales of homes, rentals, and investment land. Report each year’s installment income on Form 6252.9Internal Revenue Service. About Form 6252, Installment Sale Income
Like-Kind Exchange for Investment Property
If the property you are selling early is a rental or other investment real estate, a Section 1031 exchange defers the entire gain by rolling it into a replacement investment property. This route is not available for a personal residence, and you cannot exchange a rental into a home you plan to live in.10Office of the Law Revision Counsel. 26 USC 1031 – Exchange of Real Property Held for Productive Use or Investment
The timeline is unforgiving. You have 45 days from closing on the sale to identify replacement properties in writing, and 180 days (or your return due date including extensions, whichever comes first) to complete the purchase. Filing a tax extension is often what gives you the full 180 days when you sold late in the year.
Sale proceeds must be held by a qualified intermediary during the exchange window. If the money touches your account at any point, the IRS treats the exchange as failed and the whole gain becomes taxable that year.11Internal Revenue Service. Like-Kind Exchanges Under IRC Section 1031
When the replacement property costs less than what you sold, or when you receive cash or debt relief in the deal, the difference is “boot” and is taxable in the year of the exchange. To defer the full gain, the replacement must be equal or greater in value and all the proceeds must be reinvested. A reverse exchange, in which an accommodation titleholder acquires the new property before you close on the old one, is available when timing runs the other direction.
Qualified Opportunity Funds and the 2026 Deadline
Any capital gain, real estate or otherwise, can be deferred by reinvesting the profit into a Qualified Opportunity Fund within 180 days of the sale.12Internal Revenue Service. Invest in a Qualified Opportunity Fund These funds invest in designated low-income communities and must hold at least 90 percent of their assets in qualified opportunity zone property.13Internal Revenue Service. Certify and Maintain a Qualified Opportunity Fund
All deferred gains invested in a QOF must be recognized by December 31, 2026, whether or not you have sold your fund interest.14Internal Revenue Service. Opportunity Zones Frequently Asked Questions Any gain you defer now will appear on your 2026 return unless Congress extends the deadline, and no extension has been enacted as of this writing.
Even after that recognition date, the QOF program’s long-term benefit remains. Hold the fund investment for at least 10 years and any appreciation in the fund itself is permanently excluded from tax through a basis adjustment to fair market value on sale.14Internal Revenue Service. Opportunity Zones Frequently Asked Questions
The 3.8 Percent Net Investment Income Tax
Above certain income thresholds, capital gains carry an extra 3.8 percent tax. It hits when modified adjusted gross income exceeds $200,000 for single filers or $250,000 for married couples filing jointly, and it applies to the lesser of your net investment income or the amount by which your income tops the threshold.15Internal Revenue Service. Topic No. 559, Net Investment Income Tax
Gain excluded under Section 121, whether the full exclusion or a partial one, is not counted as net investment income. Only gain above the exclusion is exposed. The thresholds are not indexed for inflation.
Suspension for Military and Foreign Service Members
Active-duty members of the uniformed services or the Foreign Service on qualified extended duty can elect to pause the five-year lookback period for up to 10 years.16eCFR. 26 CFR 1.121-5 – Suspension of 5-Year Period for Certain Members of the Uniformed Services and Foreign Service If you bought a home, lived in it a year, deployed for eight, then returned and sold, the deployment years do not count against you. The election applies to only one property at a time.
Estimated Tax After a Large Gain
A big gain can leave you owing far more than routine withholding covers. You are generally required to make estimated tax payments if you expect to owe at least $1,000 after withholding and credits and your withholding will cover less than 90 percent of your current-year tax or 100 percent of last year’s tax (110 percent if your prior-year adjusted gross income exceeded $150,000).17Internal Revenue Service. Large Gains, Lump Sum Distributions, Etc.
You do not have to pay evenly. If the gain lands midyear, you can annualize your income and make a larger payment for that quarter, then attach Form 2210 with Schedule AI to show that uneven payments matched uneven income. If you have wages, another route is to raise your withholding for the rest of the year and skip estimated payments entirely.17Internal Revenue Service. Large Gains, Lump Sum Distributions, Etc.