When you sell your primary residence, you may be able to exclude up to $250,000 of the gain from federal income tax ($500,000 if you're married filing jointly), which means many homeowners owe no tax at all on a home sale. To qualify for this home sale exclusion, you must have owned the home and used it as your primary residence for at least two of the five years before the sale — the two years don't have to be consecutive, and you don't have to be living there at the time of the sale. If your gain exceeds the exclusion amount, the excess is taxed as a long-term capital gain (assuming you owned the home for more than a year), typically at 0%, 15%, or 20% depending on your income. A partial exclusion may be available if you don't meet the full two-year requirement due to a job change, health issue, or other unforeseen circumstance. Vacation homes and investment properties don't qualify for this exclusion, but may be eligible for a 1031 exchange to defer the gain.