Your basis is your basis, i.e., the purchase price when you bought the property before you rented it. Refinancing and rentals don't change the basis. Those transactions may, however, change the mortgage interest you can take, and can convert money you took in as rent to income. Money you spent on the house may also count as a business expense.