When are home improvements tax deductible?

When are home improvements tax deductible? What types of renovations qualify as capital improvements for tax purposes? If I do energy-efficient upgrades, are there tax credits available?

Home improvements may be deductible if they increase home value or adapt to medical needs. Energy upgrades often have tax credits!