Selling Rental Property - General Questions

Hi - my husband and I purchased a condo together in 2007. When we split up in 2013, I put the condo in my name and lived in it as a primary residence for 5 years. In 2018, I purchased a home and turned the condo into a rental unit. I am about to close on the condo next week and want to understand my tax implications. 

 

1. Primary residence, do I count the years I lived there as a primary residence from 2007 - 2013 when it was a joint property? Or just start from 2013 when I took ownership. 

 

2. Do I need to pay any taxes directly after the close? or can I just pay taxes at tax time? 

 

3. How much can I expect to pay in capital gains, and how can I minimize the taxes. 

 

4. How can depreciation that I have been paying help me minimize / or impact how much I owe. 

 

5. The condo basically operated at a loss until the end of 2021 and has been with no income since Jan. I spent around 20k in renovating before sale. Is there a way to write-off any of the reno costs? 

 

Thanks

SJ