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:
Net income after claiming all deductions from gross income and adjusted gross income, such as IRA deductions, itemized deductions, or the standard deduction, and personal exemptions.