For most homeowners selling their primary residence, the answer to “do you pay taxes when you sell your house” is no. The tax code includes a generous exclusion that shields most home sale gains from federal capital gains tax entirely. But the rules have specific requirements, and the situations where you do owe tax can be costly if you are not prepared.
This guide explains who qualifies for the exclusion, how it is calculated, and when a home sale actually triggers a federal tax bill.
The Basic Answer: Most Sellers Pay Nothing
The IRS allows homeowners to exclude up to $250,000 of capital gain (single filers) or $500,000 (married filing jointly) from federal income tax when they sell their primary residence. This is called the Section 121 exclusion.
For the majority of sellers, the gain on their home falls below these thresholds, which means no federal tax is owed on the sale. The exclusion is not a deduction that reduces your tax; it is a full exclusion of that amount from taxable income.
What Is Capital Gain on a Home Sale?
Capital gain is the difference between what you sell the home for and your adjusted cost basis:
Capital gain = Sale price minus Adjusted cost basis
Your adjusted cost basis starts with what you paid for the home and increases with:
- Qualifying home improvements (not repairs or maintenance, but capital improvements such as adding a room, replacing a roof, or installing a new HVAC system)
- Selling costs from when you originally purchased the home (closing costs that were not deductible)
It decreases with:
- Depreciation taken if you ever rented the property
- Insurance reimbursements received for casualty losses
To illustrate with round numbers: you bought a home for $200,000, spent $40,000 on qualifying improvements over the years, and sell it for $410,000. Your cost basis is $240,000. Your gain is $170,000. As a single filer, that gain is entirely excluded. You owe nothing federally.
The 2-Out-of-5-Year Rule
To qualify for the exclusion, you must pass two tests for the 5-year period ending on the sale date:
- Ownership test: You must have owned the home for at least 2 years.
- Use test: You must have used the home as your primary residence for at least 2 years.
The two years do not need to be consecutive. You can move out, rent the home, move back in, and still qualify as long as you accumulate 24 months of qualifying use within the 5-year lookback window.
You can use this exclusion once every 2 years. If you sold a home and used the exclusion less than 2 years ago, you cannot use it again on a new sale.
When You Do Owe Tax: Four Common Scenarios
Scenario 1: Your gain exceeds the exclusion.
If you are a single filer and your capital gain is $320,000, you exclude $250,000 and pay capital gains tax on the remaining $70,000. The tax rate depends on your income: 0 percent, 15 percent, or 20 percent for most taxpayers at the federal level. To illustrate: a $70,000 taxable gain at 15 percent equals $10,500 in federal tax.
Scenario 2: You do not meet the residency requirement.
If you sell before living in the home for 2 years, the entire gain is taxable unless you qualify for a partial exclusion due to a job change, health reason, or other unforeseen circumstance the IRS recognizes as an exception.
Scenario 3: The home is a rental or investment property.
Rental and investment properties do not qualify for the Section 121 exclusion at all. Gains are taxed at capital gains rates, and you also owe depreciation recapture tax at up to 25 percent on any depreciation you claimed during ownership. This is a significant expense that surprises many landlords selling rental homes.
Scenario 4: You claimed the home office deduction.
If you deducted a portion of your home as a business space, the gain attributable to that portion is not eligible for the exclusion and is taxable as depreciation recapture.
What Selling Costs Reduce Your Gain
When you sell, certain costs reduce your capital gain dollar for dollar:
- Agent commission (if paid by you)
- Seller closing costs: title fees, transfer taxes, escrow fees
- Legal fees directly related to the sale
- Advertising costs if you sell without an agent
These costs are not a deduction on your return in the year of sale for most taxpayers. Instead, they reduce the sale price for purposes of calculating your gain. If you pay $16,500 in commission on a $300,000 sale, your effective sale price for tax purposes is $283,500, which reduces your gain by $16,500.
State Income Tax on Home Sales
The federal exclusion does not automatically apply at the state level. Most states conform to the federal exclusion, meaning no state income tax is owed if you qualify federally. However, some states have their own rules or lower exclusion amounts. States with no income tax (such as Florida and Texas) impose no state tax on the gain at all. Check your specific state rules or consult a tax professional before closing.
Does a Cash Sale Change Your Tax Obligation?
No. The way you sell your home (through an agent, for sale by owner, or directly to a cash home buyer) has no effect on your federal capital gains tax calculation. The tax is based on the gain, not the method of sale. If you qualify for the exclusion, you qualify regardless of how you sell. If you owe tax, the same calculation applies.
What does matter is the net proceeds you walk away with. Use our net proceeds calculator to estimate your gain, your tax exposure, and what you keep under each sale scenario.
A Note on Inherited Homes and Other Special Cases
The tax rules for a primary residence sale described here are different from the rules for inherited property, which involves a step-up in basis and different exclusion eligibility. If you are selling a home you inherited, see our detailed guide on how to sell an inherited house for the tax rules specific to that situation.
The Bottom Line
Most homeowners who meet the 2-of-5-year primary residence rule and have a gain below $250,000 (or $500,000 married) owe no federal tax when they sell. The tax becomes relevant when you have a large gain, have not met the residency requirement, or are selling a rental or investment property. In those cases, the capital gains rate and potential depreciation recapture can represent a meaningful cost to plan for before you close.
Understanding your tax exposure is part of knowing your true net from a home sale. Get a no-obligation cash offer from Homewise and pair it with your tax estimate to see the full picture before you decide how to sell.