Understanding the tax rules around selling your home can save you big bucks, but you have to keep good records.