Investors & landlords

sorry to be a bother here but this is the confusing part"  here will be "Unrecaptured Section 1250 Gain" from the depreciation for all three units when it is sold.  There won't be any additional depreciation on your personal unit once it became a non-rental unit."  When the building is sold , I pay recapture gain on the depreciation of the entire building since purchase OR I figure out which years one unit was owner occupied and pay recapture on that unit only for the years it was not owner occupied?  Sale may soon as I am retiring this year