roofy
Money

Capital Gains Tax When You Sell Your Home

The $250,000/$500,000 home-sale exclusion under IRS Pub 523: 2-of-5-year tests, partial exclusions, adjusted basis, New York tax and IT-2663 for nonresidents.

9 min read · Updated

If you owned and lived in your home as your main residence for at least two of the five years before you sell, you can usually exclude up to $250,000 of profit from federal tax, or $500,000 if you are married and file jointly. Only gain above that amount, or gain from a home that doesn't meet the tests, is taxed as a capital gain.

The rule is Section 121 of the Internal Revenue Code, explained in IRS Publication 523. Use the decision tree to check your eligibility, then the worked example to figure your gain. The same exclusion applies to houses, condos and co-op apartments.

At a glance

Exclusion, single
$250,000
Exclusion, married filing jointly
$500,000
Both spouses must meet the use test
Ownership and use
2 of 5 years
24 months each, need not be continuous
How often
Once every 2 years

Do you qualify? Answer five questions

Section 121 home-sale exclusion checker

Step 1

Did you get this home through a 1031 (like-kind) exchange within the last 5 years?

How to figure your gain

Your gain is not the sale price minus what you paid. Pub 523 works it out in three steps:

  1. Amount realized = sale price minus selling expenses. Selling expenses include commissions, advertising, legal fees and, if you paid them as the seller, transfer taxes.
  2. Adjusted basis = what you paid (including the down payment and the borrowed amount; for a co-op, the price of the stock) plus certain purchase closing costs and the cost of improvements still in place, minus items such as depreciation you claimed or casualty losses you deducted.
  3. Gain = amount realized minus adjusted basis. Then subtract your exclusion.

What adds to your basis, and what doesn't

Basis items under IRS Publication 523
Adds to basisDoes not add to basis
Purchase price, including borrowed moneyRoutine repairs and maintenance
Some purchase closing costs (e.g., legal fees, title insurance, transfer taxes you paid as buyer)Loan costs such as points and mortgage insurance
Improvements still in place: additions, new systems, a new roof, a renovated kitchenImprovements you later removed or replaced
Repairs done as part of a larger remodelItems with a useful life of less than one year
Special assessments for local improvementsCondo or co-op assessments that are just for repairs or maintenance
Source: IRS Publication 523

Worked example: an NYC condo bought in 2014

Illustrative numbers
StepAmount
Purchase price (2014)$600,000
+ Purchase closing costs that count toward basis$10,000
+ Kitchen renovation$60,000
+ Replacement windows$15,000
= Adjusted basis$685,000
Sale price (2026)$1,100,000
− Commission (assumed 5%)$55,000
− NYC RPTT (1.425%) and NYS transfer tax (0.4%)$20,075
− Seller attorney (assumed)$3,000
= Amount realized$1,021,925
Gain (amount realized − adjusted basis)$336,925
Taxable gain, single filer ($250,000 excluded)$86,925
Taxable gain, qualifying married couple ($500,000 excluded)$0

Without the renovation receipts, the single seller's taxable gain would be $75,000 higher. That is why record-keeping matters. Run your own numbers in the home sale capital gains calculator; transfer tax amounts are explained in NYC seller closing costs.

How taxable gain is taxed

Federal

A home owned more than one year produces a long-term gain, taxed at 0%, 15% or 20%. For 2026, the 0% rate applies to taxable income up to $49,450 for single filers and $98,900 for married couples filing jointly; the 15% rate runs up to $545,500 single and $613,700 joint; above that it is 20% (Rev. Proc. 2025-32). A home owned one year or less produces a short-term gain taxed as ordinary income.

The 3.8% Net Investment Income Tax can also apply to the taxable part of the gain if your modified AGI is over $200,000 (single) or $250,000 (joint). The IRS says gain on the sale of a personal residence that is excluded from income is not net investment income.

New York State and City

New York's income tax starts from your federal adjusted gross income, so gain you exclude federally under Section 121 generally stays out of your New York income too. Taxable gain is included in New York income and taxed under the regular rate schedules; there is no separate lower capital-gains rate in the New York return. NYC residents also owe NYC income tax on it.

Reporting the sale

  • If you received Form 1099-S, report the sale on Form 8949 even if all of the gain is excluded.
  • If any gain is not excludable, report it on Form 8949 and Schedule D.
  • If neither applies and you qualify for the full exclusion, you generally don't have to report the sale.
  • Gain on a business or rental part of the property goes on Form 4797.

Records to keep

Pub 523 says to keep records of your basis, including improvements, until three years after the due date of the tax return for the year you sell. Practically, that means keeping from the day you buy:

  • Your purchase closing statement and contract
  • Receipts, contracts and permits for every improvement (renovations, systems, windows, additions)
  • For co-ops and condos, records of any special assessments for capital improvements
  • Your sale closing statement showing commissions, transfer taxes and legal fees
  • Records of any depreciation claimed for rental or home-office use

Next steps: see how to sell a home in NYC, and if you inherited the home, read selling an inherited home, since basis rules differ. Investors should read 1031 exchange basics.

Fact-checked October 12, 2026

Pub 523: ownership and use tests (24 months in 5 years), once-in-2-years look-back, $250,000/$500,000 amounts and joint-return conditions, 1031 five-year bar, partial exclusion reasons and formula (shortest period / 730 days x $250,000), selling expenses, basis items, depreciation after May 6, 1997 not excludable, Form 8949 reporting when a 1099-S is received, record retention. 2026 0%/15% thresholds from Rev. Proc. 2025-32. NIIT thresholds and Section 121 treatment from irs.gov. NY: NY AGI starts from federal AGI (IT-201-I); IT-2663/IT-2664 rate 10.90% for 2026 and the IRC 121 principal-residence exemption from the 2026 forms and instructions. Worked example amounts are illustrative; arithmetic re-computed (basis $685,000, amount realized $1,021,925, gain $336,925). Fact-check 2026-10-12: replaced "job loss" with the unforeseeable event Pub 523 actually lists (eligibility for unemployment compensation) and aligned the NIIT wording with irs.gov.

Sources

  1. Publication 523 (2025), Selling Your Home · IRS (accessed October 12, 2026)
  2. Topic no. 409, Capital gains and losses · IRS (accessed October 12, 2026)
  3. Rev. Proc. 2025-32 (2026 inflation adjustments, capital gains rate thresholds) · IRS (accessed October 12, 2026)
  4. Net Investment Income Tax · IRS (accessed October 12, 2026)
  5. Instructions for Form IT-2663 (2026), Nonresident Real Property Estimated Income Tax Payment · NYS Department of Taxation and Finance (accessed October 12, 2026)
  6. Form IT-2663 (2026) · NYS Department of Taxation and Finance (accessed October 12, 2026)
  7. Form IT-2664 (2026) · NYS Department of Taxation and Finance (accessed October 12, 2026)
  8. Instructions for Form IT-201 (New York adjusted gross income) · NYS Department of Taxation and Finance (accessed October 12, 2026)

General information, not legal, tax or financial advice. Rules change; confirm with the agency or a professional before you act.

Keep reading