Investors & landlords

Not quite right ... you must  recapture the depreciation allowed or allowable on the time it was a rental as ordinary income not cap gains.    This cannot be excluded.