I work in a country and live in another. My taxes and social contributions are only paid in the country where I work and healthcare coverage is provided in both countries. There are tax agreements between countries to avoid double taxation, but I guess Brexit makes things complicated.
The whole tax thing is taken care of by professionals appointed by my employer. And the pilot figure in the tax treaties I mentioned are a particular figure and it's clearly stated taxes are paid where the operator is based. My base is also in the same country so that probably makes it easier.