Please follow https://www.irs.gov/newsroom/tax-tips-for-taxpayers-to-consider-when-selling-their-home.