Tax Year Prior to 2020: how to calculate the business portion of rental property

I bought a condo in 2007, lived there and moved out in Oct 2010. After moved out I converted it to a rental property until 2018. After tenants moved out in Sept 2018, the condo was for sale and sold on June 2019. how do i calculate the business portion of the rental property? is it the business portion 100% or only the time between 10/2010 to 06/2019 counted as business portion?