There is a specific kind of regret that arrives about three weeks after your house closes. The money is in your account, the buyers are unloading boxes, and you are running the numbers again, except now you are calculating what you owe rather than what you made. The profit you were mentally spending is often not the profit the IRS is going to see.
The gap comes from two calculations most people skip: what it cost you to own the home, and what it cost you to sell it. Add a $250,000 exclusion with more conditions attached than most people realize, and a sale that looked tax-free turns into a real bill.
The sale price is not your profit
Start with the settlement statement number, then subtract in the right order. Your basis is what you paid to acquire the home, plus the improvements you made, plus certain purchase costs. Your amount realized is the sale price minus the costs of selling it. The difference is your gain, and only that difference is taxable.
- Added to your basis: the purchase price; the title search, title insurance, recording fees, and appraisal you paid at closing; and capital improvements: a new roof, a kitchen remodel, new flooring, a permitted addition.
- Not added to your basis: repairs and maintenance. Repainting, landscaping, a replaced dishwasher, a fixed leaky faucet are the cost of keeping the house, not improving it. It is the most common basis mistake, and it costs people thousands in both directions.
- Subtracted from the sale price: your commission, attorney or title company fee, transfer and recording taxes, advertising, staging or cleaning, and any seller concessions you paid toward the buyer’s closing costs.
One change since 2018 catches people off guard: selling costs now reduce your gain directly instead of being itemized on Schedule A. They shrink the capital gain, not ordinary income.
The exclusion has three doors, and people walk through the wrong one
The $250,000 exclusion, or $500,000 married filing jointly, covers most people’s gain entirely. You get it only if you clear three tests at once.
- Two-year ownership: you must have owned the home for at least two of the five years before the sale. Sell in October 2026 and that window runs back to October 2021.
- Two-year use as your primary residence: you must have used it as your home for at least two of those five years. A house bought as an investment that you lived in for fourteen months before listing does not qualify, no matter how long you owned it.
- You must have lived in it at least half the time during that two-year window. Temporary absences count as time you lived there, including military duty, a hospital stay, full-time school, or a one-year work assignment.
The ownership and use tests need not be the same two years, but if they overlap for less than a full year your exclusion shrinks. The rule with no exceptions: a rental gets no exclusion at all. Convert the property to a rental, or move out and rent it while you live elsewhere, and you have an investment property.
The math, worked
Buy in 2019 for $340,000, pay $8,000 in buyer closing costs, and spend $45,500 on real improvements over six years: a roof, a kitchen, floors, a bathroom. Your basis is $393,500. Sell in September 2026 for $565,000, with $30,000 in commissions, $1,200 in attorney fees, $600 in recording taxes, $900 for staging, and $14,000 in concessions to the buyer. Your amount realized is $518,300, so your gain is $124,800.
Lived there the whole time and file jointly, up to $500,000 of that gain is excluded. Federal tax owed: zero. Now change one fact: you bought the house in 2024, lived in it fourteen months, and listed it last spring. Identical prices and numbers, and there is no exclusion at all. On $124,800 of gain at the 15% long-term rate, plus the 3.8% net investment income tax if your income puts you over the line, you owe roughly $23,000 on a sale most people thought was tax-free.
Five traps that turn a routine sale into an expensive one
1. Renting out the new place within two years
Buy a replacement home within two years of the sale and rent it instead of living in it, and the exclusion is disallowed. You file Form 5405, pay the tax, and pay a 10% penalty on top. This catches people who move for work and rent out the old place while the new one finishes.
2. Buying back the same house
Buy the home you just sold back within five years and the IRS treats it as one continuous ownership, so you cannot claim the exclusion again. The flip-around move people use to reset their basis costs the exclusion on the original gain.
3. Filing separately in the year you sold
If you and your spouse lived in the home and file married filing separately for the sale year, the exclusion drops to zero. That catches people in separation or divorce who assume filing status is a separate question from the sale.
4. The 55-and-over exclusion
At 55 or older you can exclude up to $250,000, or $500,000 jointly, of gain even if you never met the two-year primary residence test. It does not stack with the regular exclusion, and permanently reduces the basis in the home you buy next.
5. State tax
The federal exclusion does not bind your state. Several states tax capital gains separately, and some add surtaxes at higher incomes. Check your state rules before treating a sale as tax-free.
What to do in the first 30 days
- Ask the title or escrow company for the gross profit statement, which shows your sale price, the commission, and your real closing costs: the numbers the IRS will use. Then rebuild your basis from the original closing statement plus every improvement invoice you kept.
- File Form 5405 if you bought another home and are not living in it as your primary residence.
- Pay the tax in the year you sold, not the year the money arrives. Close in October and the tax is due with your April return. If the money is going into a move, make estimated payments before January 15 to avoid an underpayment penalty; the safe harbor is based on your prior-year tax.
- Keep the file for three years. The IRS generally has three years from the filing date to assess a return; the clock starts when you file, not when you sold.
The IRS publishes a free worksheet called Sales of a Home in the Form 1040 instructions, and Publication 523 covers the rules in detail. Working it with your own basis and closing documents takes an afternoon, and it is the difference between knowing what you owe and discovering it later.
Image: “House keys on Money” by Images_of_Money, released under CC BY 2.0 via Flickr.