Hi,
If you stay too long in the UK, you will become tax resident. This means that you would be taxable on your worldwide income in the UK, on the 'arising basis', which would be declared on a Self Assessment tax return.
You may also have the option of claiming the remittance basis of tax, where you would declare your income, and, or capital gains brought into the UK and pay tax on that.
You should review the guidance on statutory residence and take the residency test to determine your residency position. This will allow you to work out how many days you can be in the UK and be considered not tax resident. You can see guidance, and take the tests here:
RDR3 Statutory Residence Test
You should review the guidance on the remittance basis, to work out if this is an option.
Residence, domicile and the remittance basis: RDR1
Thank you;