When you complete your application you’ll be asked if you have the right to work in the UK. If appointed, evidence of eligibility to work in the UK will need to be provided.
All successful candidates are required to undertake a National Security Vetting check, so as part of the application process you will be asked if you have been resident in the UK for a minimum of three years.
Whilst a lack of UK residency in itself is not necessarily a bar to security clearance, the checks must be able to produce appropriate results to inform the decision making process and to provide the required level of assurance.