It is definitely not automatic. Residency is usually tied to investment programs or employment. If you are looking to purchase, always prioritize checking the legal status of the building. You should definitely check out
this guide on Act 16 to avoid buying a property that isn't fully legal for habitation.