You can defer capital gains tax by buying another house through a 1031 exchange, which allows you to reinvest the proceeds from the sale of one property into another similar property without recognizing the gains. However, you cannot avoid capital gains tax entirely unless you meet certain criteria for the home sale exclusion or other tax benefits.