The capital expenses to improve the property for sale can be added to the cost basis of the rental house which will reduce gain at the time of sale. Any expenses paid that are necessary to sell the house will be selling expenses and also will be used to reduce the taxable gain at the time of sale.
Any expenses that are paid for the rental while it was available and or listed for rent (even during the time you trying to sell at the same time) can be expensed on the rental activity.