There is no simple answer to this.
There is a general rule that if you work for a UK employer from a fixed base in the UK, HMRC have first claim on taxation arising on your income, even if you are fiscally resident elsewhere.
From the little you have said, it sounds as if you would not be considered as working from a fixed UK base, so the above may not apply to you.
Liability will also be determined by where you are fiscally resident, what dual-taxation treaties exist between the UK and that country, how long you spend in the UK and elsewhere, and other factors.
Seek expert advice, as failure to do could be very costly, both because you may pay more in tax than you need to, and also because if you, even unknowingly, fall foul of the regulations, the penalties are severe. You are unlikely to end up in prison but you could find yourself forking out a lot in fine.