Question about selling home

I have a question about my primary residence.  I have owned a house in VA for over 30 years and lived half- time between VA and FL since 2016.   By half-time, I mean about 180 days each.    When I read the IRS pub 523, it states you have to have 2 years out of the last 5 living in the house for the exemption.  However, it also states the time does not have to be a single block of time.  My question is, does living in the VA home 6 months out of the year allow me to avoid paying the capital gains tax on the sale.  

 

I do maintain an FL driver's license and vote in FL and do not change each time I relocate.

 

Thanks

Gary