Deductions & credits

I'm not sure how the AGI figures in here with this value.   Doesn't the capital gains exemption occur before the AGI is calculated?    Or maybe you were speaking in general if a house was a higher value home.