You do need to talk to an accountant, but if this home were your residence and not a rental, generally speaking, the proceeds of the sale will not be included in your income next year.
Your gain or loss is calculated as follows:
Original purchase price + cost of any upgrades and renovations = Your total asset
Compare that number with the sales price, and you have your gain or loss on the sale of the asset.
If it's a gain, and you are single, you can claim up to $250,000 and pay no tax on the gain. $500,000 if you are married and filing a joint return.
If it's a loss, no, you cannot claim the loss. (I agree - that is not fair.)
As far as records retention for this transaction, the minimum is 6 years. As accountants, we often told people to keep the following records forever: Birth certificates, death certificates, divorce decrees, and real estate transaction paperwork.
This page has a nice general review of record retention policies.