It depends on whether you qualify for the home sale exclusion. This 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:
A business method of accounting requiring income to be reported when earned and expenses to be deducted when incurred. However, deductions generally may not be claimed until economic performance has occurred.