We are often approached by clients who have recently moved to the UK (returning ex-pats of foreign nationals) and are seeking a mortgage.
Most lenders want you to have been here 2/3 years so you will eliminate quite a few if this isn’t the case.
However, a couple will lend but it’s all about credit score.
The best way to improve your chances is to ensure you are registered everywhere! Ensure you’re on the electoral roll. Bank accounts, utilities, loans, credit cards etc. are all registered at your current home.
This applies to residential mortgages, for B2L it’s a lot tougher and generally at least 1 year UK residency would be required for the odd lender again with most wanting 2/3 years and without having to opt for more flexible and thus more expensive lenders.
Also note this would assume permanent rights to reside (indefinite leave to remain) in the UK. Some lenders will consider visa situations but the class of visa and term remaining on it are key. There are no hard and fast rules as each lender has different criteria in this regard. Again this is much easier for residential mortgages than B2L mortgages.