Hello and welcome to the site. Thank you for your question.
In order to be able to claim private residence relief and be exempt from capital gains tax on sale of property, you have to satisfy two conditions.
For the whole time that you have owned the property -
- it's been your only home or main residence
- you have used it as your home and nothing else.
It is clear from your statement that the flat is a second home. Provided you have both lived in the flat as your main residence at some point then you would be able to claim private residence relief for the period you lived in the flat as your main residence against potential capital gains tax on sale of flat.
You can only have one main residence at any one point. One of you moving into the flat on its own would not qualify you for private residence relief.
If you wish to mitigate your CGT liability then you would both have to consider moving from the house to the flat and making the flat your main residence. This move would enable you to claim PRR for the period it is your main residence.
More information on how private residence relief works can be found on HMRC helpsheet HS283 here
I hope this is helpful and answers your question.