Hi rachelhar,
You would need to researsh:
Tax treaties
For a tax treaty between the UK and your country of residence.
If there is a tax treaty, you should review the treaty for guidance on capital gains tax and how that tax is applied.
Any dividends from the share or capital gain, should be declared to HMRC.
Thank you.