Does buying real estate in the USA automatically mean transferring tax residency to the USA?

No; tax residency is based mainly on citizenship, green‑card status, and the number of days you spend in the USA (substantial presence test), not mere ownership of property.​