That's a good question.
Housing abroad is governed by different regimes. Different approaches are used to provide staff with housing. A dwelling can be owned, and assigned to the diplomat; a dwelling can be rented for a diplomat's use; or, particularly in the United States, a diplomat can be asked to find a home and sign a lease for it as a private individual, and the department will reimburse the monthly cost.
So there are three ways of doing it.