Jnrbiland33 Though it might be different for UK (don't think so), the basic layout many opinion-givers miss and then get you confused unnecessarily is the need to DECLARE the income where you are a tax resident (different triggers and release conditions, can be multiple countries synchronously) and only then it gets decided which share of what income is taxed where and how much can be credited to or from the other end to PAY it.
Personal Income Tax that is. Social Security contribution and National Health insurance need to be figured out in addition to the above via a process severely less deterministic.
The results vary wildly among the different personal and life configurations. For instance, apparently retirees on German pension wishing to move outside the EU will get their government payout cut by 60%. That's a lemon to predict 30 yrs or so in advance!