If you sell your primary home, you may be able to exclude up to $250,000 of profit from taxes ($500,000 if married filing jointly) — this is the Section 121 exclusion. To qualify, you must have owned and lived in the home for at least 2 of the last 5 years. Profit above the exclusion is taxed as a capital gain. Home improvements you made increase your cost basis, reducing your taxable gain. Keep records of all home improvements.