If you use a UK-based broker (such as HSBC Expat's InvestDirect), you will be subject to UK tax laws.
As a UK non-resident, it means you will still have to pay taxes on any income from your investments such as dividends. If these are quite low (below GBP11k per year) then in effect these will be below the tax threshold and will be zero tax. If however you gain rental income then the dividend income will be added to your rental income when you calculate your total UK tax liability.
As a UK non-resident, you do not pay taxes on capital gains on shares and investments except for property and property-linked investments such as REITs. This applies as long as you have been non-resident for at least 5 tax years.
Therefore, to reduce tax liability, if you are investing in ETFs it is best to look at accumulating ETFs and not distributing ETFs. This is where dividends are reinvested and so are shown as capital gains for which UK non-residents don't pay tax.
Also, AFAIK, if you are moving back be very careful when you sell your shares to book your capital gains as a non-resident. You need to do so in the tax year before you become resident in the UK. So for example don't sell up all your shares in May, and then move back in June because you will become UK resident in the same tax year you sold up your shares. UK tax year starts on 6 April, so if you intend to move back after 6 April you need to book your capital gains before 6 April. Or you can avoid being a resident in a tax year if you live in the UK for fewer than 183 days in the tax year.
Useful thread, thanks everyone!
Just on the taxation of dividends, this link seems to suggest they are taxable, except tax at source, but only if you then do not make use of any persons tax allowances for property income.
To put it another way; if I have no property income then I can take dividends tax free...but if I have property income then I need to make a choice - am I reading that correctly?