Quick Answer — How Much Tax Do You Pay When You Sell Your Home?
Often none. IRC Section 121 lets you exclude up to $250,000 of gain on the sale of a main home, or $500,000 if married filing jointly, provided you owned the property and used it as your principal residence for at least two of the five years before the sale. The two years need not be continuous, and you generally cannot use the exclusion more than once every two years.
The arithmetic runs in this order: Amount Realized = Sale Price - Selling Costs; Adjusted Basis = Purchase Price + Improvements - Depreciation; Gain = Amount Realized - Adjusted Basis. Depreciation recapture comes off that gain first, the exclusion applies to what remains, and anything still left is a long-term capital gain.
Worked example: a couple filing jointly sell for $750,000 with $45,000 of selling costs, having bought for $400,000 and made $60,000 of capital improvements, with no depreciation ever claimed. Amount realized = $705,000. Adjusted basis = $460,000. Gain = $245,000 — inside the $500,000 joint limit, so the entire gain is excluded and the federal tax is $0.
Two things routinely break that clean result: depreciation claimed for a home office or a rental period, which can never be excluded, and selling before the two-year test is met, which reduces the limit. Both are modelled below.
This is the primary-residence rule and nothing else. Investment property is a different regime entirely — see the 1031 exchange tax calculator — and gains on assets other than a home belong in the capital gains calculator.