If you're paying off another dwelling-secured loan and this loan will be secured by the property being converted, I would say this is reportable as a refinancing. However, if the loan you're paying off was secured by this same building when it was used as office space, it doesn't sound like it was necessarily a dwelling.
You would report the full amount of the loan and then the sale, unless you're keeping the majority interest.
Assuming the 20 condos are in one structure and there are no additional units you're not taking as security, I would say this is multifamily. However, the commentary gives an example that if you're only buying 10 units in a 100-unit complex, it's not multifamily. If 4 units are income-restricted, I would agree those would be reported as affordable housing units.