From the facts alone, it seems apparent that the second home is an investment property the moment that you rented it out. Effectively you have converted this residential property into an investment property!
So, for an investment property, any expenses such as repairs, maintence, dues, insurance, mortgage interest and taxes would be deductible. Then, on the sale of the property, you can deduct your basis, closing costs and any commissions paid to the realtor. Based on the facts, I think you were very smart to have leased the property to a tennant, and so, you can have the advantage of deducting lossses on Schedule E and deduct an investment loss, or capital loss on sale of the property subject to the capital loss limitation rules, assuming of course you sold the property at a loss.