Deductions & credits

@taxman6236   Yes, that meets the residence requirement.  That does NOT mean they qualify to exclude ALL of the gain.  The original answer is correct.