Under most EU country tax laws your "usual residence" which determines in theory where you should pay your taxes is where you reside "most of the year" that translates to 183 days.
What not-so-few people try doing is to establish "on paper" residence in a lower tax country while staying most of the time in the (usually) state where they were born, have family, relations and often also economical interests.
While (again usually) most retired people actually move to the other country, often because - besides the tax lowering - it offers better climate, lower costs, etc., a number of people still working try that way to simply save on taxes, particularly if having a large income and thus being on a higher tax bracket.
Once a month or so there is a newspaper article here in Italy about <put here the name of a reknown athlete/singer/musician/actor/artist/whatever> having been fined for high sums for having established residence in (say) Montecarlo or in the UK (before Brexit) but actually being in Italy all the time or nearly so.
“If you have retired to another EU country and spend more than 6 months a year there, that country may consider you a tax-resident. If so, you may have to pay tax to that country on your total worldwide income - including pensions you receive from other EU countries.
Exception: public sector pensions are usually taxed only in the country of the administration that employed you.”
But yeah, the above website is called Your Europe, and it is extremely useful for such information.