Hi,
You can claim private residence relief for the period that the first property was your main residence plus a further 9 months over the number of months that you owned the property.
For example. (5*12)+9 = 69 over 6/12 = 72. 69/72.
Have a look at the helpsheet HS283 below for more advice.
HS283 Private Residence Relief (2023)
Stamp duty paid on the second property, could only be set against capital gains arising on the disposal of that second property. Have a look at the guidance on stamp duty and land tax at:
Stamp Duty Land Tax
Thank you.