But if i paid taxes in country B, while i was living in country C with the digital nomad visa, how can country A claim again some taxes?
It would depend on the laws of country A, obviously. It's not enough to pay taxes, you also have to pay them to the right country.
Fictitious example. Say the tax laws of country A say: "You cease to be tax resident in country A if and only if you take up permanent residency in and become tax resident of a country that we have signed a tax treaty with. Otherwise you will remain tax resident in country A."
Country A has signed a tax treaty with country B. But country B only considers you tax resident if you spend at least 60 days per year in the country.
Now you move to country B on paper, but you really live in country C.
Country C says "if you are in our country on a digital nomad visa, you cannot be considered tax resident" - and country C also hasn't signed a tax treaty with country A. So country C is out.
But country B is also out since you're not spending the required 60 days there, thereby no longer fulfilling the "you are tax resident of a country we have signed a tax treaty with" condition.
So based on that you would remain tax resident in country A and have to pay taxes there.
But that's just something I made up now to illustrate a hypothetical problem. In practice, I cannot imagine this would be an issue. But you should work with tax lawyers from countries A and B to be sure.