Thank you for that information, we can now proceed!
Here is the HMRC guidance on spouses and Capital Gains Tax (CGT):
'You may be entitled to Private Residence Relief on any gain arising on the disposal of your only or main residence. You and your spouse or civil partner cannot have more than one residence or main residence between you for the purposes of the relief at any time while you are living together. (You are treated as living together unless you are separated under a court order or by Deed of Separation, or are otherwise separated in such circumstances that the separation is likely to become permanent.)'
Now for one of your houses you will definitely be liable to CGT on disposal. The other may well obtain a modicum of relief as time spent in job related accommodation extends any period of Private Residence Relief (PRR).
Assuming that you made no election as to which dwelling is the be your sole of main domestic residence within two years of the acquisition of the second house then HMRC will base the decision on the facts available. The house upon which you made the loss is clearly one you don't want for PRR, but it does create a capital loss of 15K [half each] in your books. You should declare the loss on disposal in your next annual self assessment tax return to carry forward for future use.
The other residence should escape CGT altogether on the following grounds. You are entitled to PRR for the period of occupation plus any absences caused by your work and living in job related accommodation. Finally the last 18 months of ownership do not count at all so, as I say, you should escape scot free.
However, in your position I should be inclined to retain the solicitor who handles the conveyancing of these properties with a view to his negotiating your property transactions and CGT with HMRC.
I do hope I have helped with your problem with this brief canter through CGT, a highly complex tax..