UK tax residency is settled by the Statutory Residence Test. You are automatically resident if you spend 183 or more days in the UK in the tax year, and automatically non-resident if you spend fewer than 16 days. Between those limits, the sufficient ties test combines days in the UK with the number of UK ties you hold.
Fewer than 16 - Automatically non-resident - Automatically non-resident
16 to 45 - Cannot be resident on ties alone - 4 ties
46 to 90 - 4 ties (all of them) - 3 ties
91 to 120 - 3 ties - 2 ties
Plus 2 more in the full guide

freedomisntfree.co.uk/guides/uk-tax-residency-explained