In working out your tax liability, residency applies to both you personally and your company.
Because the UK taxes its residents on their worldwide income and gains, your personal tax residency helps determine the scope of your personal tax liability. Your company has separate legal status, so if your company is registered in the UK – either in England and Wales, Scotland and Northern Ireland – it will be taxed on its worldwide income. However, if you control and manage your company outside the UK, then your company will have tax residence in the UK and another country – meaning it would be subject to double taxation.