Sale of a rental property

Hi..I am owner of a rental property, which I am selling and is now closing at end of May 2020. The background is as follows:

I lived in that rental property from Oct 2007 to Dec 17 2016, which is when I moved to a new house, which became my primary residence. From Dec  18, 2016 to Sep 30 2019, I rented out the property. Post the tenant leaving end of Sep 2019, I renovated the property and attempted to put it up for sale from Nov 1, 2019. The property is sold and closing at end of May 2020. Will I get a benefit from the 2 of the 5 year rule - 500K (Married filing jointly) for exclusion on capital gains tax, considering I moved into the new house in Dec 2016, and I am not closing on the sale of rental property until end of May 2020 even though it was not rented out from Oct 1, 2019 onward and on attempt to sell.