Hi,
You will need to review the guidance on statutory residence to determine your residence status here:
RDR3 Statutory Residence Test
If you are tax non resident for the whole tax year, you would not be required to declare this income in a tax return.
If you are tax resident for the whole tax year, you would be required to declare it and claim any appropriate foreign tax credit.
Thank you.