Ideally, you should obtain a tax residence certificate, so you need to get a residence permit and not just a visa.
In Estonia, as soon as you get a residence permit, you can immediately get a tax residence certificate from day one, but it doesn't work like this with just visas or based on...