Selling a home involves calculating the adjusted basis, which includes the purchase price plus capital improvements, minus any credits or subsidies. Gains are determined by subtracting the adjusted basis and selling expenses from the sale price. Up to $500,000 of gain ($250,000 for singles) may be excluded if ownership and residence tests are met. Special rules apply for inherited, gifted, or business properties. Report gains on tax returns if taxable or if a Form 1099-S is received.