Sales of Rental Property that used to be primary residence

I sold my rental property in 2020 for a profit. I bought the property in 1990 and used it as my primary residence for 6 years. I rented it out for the last 24 years.  Do I pay capital gains on the total gain (sales price - minus basis + depreciation recapture) or can I pro-rate the gains by the percentage of rental use to total use  (24 yrs/30 yrs). If not, can I use the FMV in 1996 as the original basis?