The home sale exclusion lets you omit from gross income up to $250,000 of gain ($500,000 on a joint return), but only if you meet certain conditions:
Gross income less allowable adjustments, such as IRA, alimony, and Keogh deductions. AGI determines whether various tax benefits are phased out, such as personal exemptions, itemized deductions, and the rental loss allowance and modified adjusted gross income (MAGI).