If you qualify for split year then you only report any foreign income for the UK part of the year RDRM12000 - Residence: The SRT: Split year treatment:
If you do not qualify then you will need to report all your foreign income to the UK Tax on foreign income
The guidance at RDRM12150 - Residence:
will help you work out if split year treatment applies.
UK rental income remins liable to tax in the UK no matter where you are resident and you will therefore need to complete a tax return to show this.
For 23/24 you will declare your employment income and rental income and you will need to enclose HS304 Non-residents — relief under double taxation agreements (2021)
As for being a Spanish tax resident, you will need to submit a Residencia Fiscal en Espania Convenio certificate to confirm taxes are being paid in Spain.