Please follow https://www.irs.gov/help-resources/tools-faqs/faqs-for-individuals/frequently-asked-tax-questions-answers/capital-gains-losses-and-sale-of-home?_ga=1.84069470.61815849.1475014920.