If you can't speak the language and use local expressions, then you'll always be an outsider.
Source: moved to Colombia 5 years ago and took me 3 years to have people say "tu si eres bien Paisa" and "usted es mas Paisa que una arepa". Have seen a small minority of other foreigners get accepted. Most never learn the language / culture enough and will always be outsiders.
When you start paying taxes and contributing/engaging to the area (working, consuming, giving)
This, quite obviously, varies a lot from place to place - but IMO, if you fill the above points, you're as good as natives. But I think the biggest divider between insiders and outsiders is engagement - if you start engaging in the community, that's the fast-track to getting accepted.
the reality is for many that point is never reached. in some places, if you are not born there you are not accepted as a local.
i am not talking about digital nomands, but families with children who move because of a job or because of their kids school or other personal reasons. my family was forced to move 3 times in the past two years, and not because we didn't intend to stay, but because we couldn't.
a friend of mine tried to run a business in a german city and had to give up because the local old boys club would prevent him from getting customers.
this is the attitude that xenophobia is rooted in.
sure, someone staying only for a few days is a tourist, no matter how you turn it, but if someone staying for a few months is still treated like a tourist, then i'd consider that a problem.