Hi,
How you record your income depends on which method of accounting you use. If you use cash basis accounting, only record the rent in the tax year it was received, you can see guidance here:
Cash basis
There are some differences if you use traditional accounting, accruals basis, where you record income when you invoice your customers and expenses when you receive a bill. You can read more about this here:
HS222 How to calculate your taxable profits (2024)
Thank you.