You might refer to HS283 here as for relevant background information. HMRC may ask for proof of the improvement costs in the form of receipts and invoices.
I will give you two lots of figures. The first set will be with you as the sole owner at the time of disposal of the property. The second set will be with the property as jointly owned with your wife at the time of disposal. If you sell the property after it has been vacated and your wife's name is ***** ***** on the deeds after it has been vacated by the tenants, she will not qualify for letting relief as the property will have not been let during her part ownership of it.
YOU AS SOLE OWNER
Period of ownership 209 months
Period of occupation 172 months
Period of letting 37 months
Exempt gain £798,182 (£878,000 / 209 months x 190 months (172 + 18))
Non-exempt gain £79,818 (£878,000 / 209 months x 19 months (37 - 18))
Letting relief £40,000 (lesser of £40,000, £798,182 and £79,818)
Annual CGT exemption £11,100
Net taxable gain £28,718 (£79,818 - £40,000 - £11,100)
CGT at 28% £8,041.04
Your share of the non-exempt gain of £79,818 will be £39,909 and that will be covered by letting relief of £39,909 so you will have no taxable gain.
Your wife's share of the of the non-exempt gain of £79,818 will be £39,909, there will be no letting relief but the annual CGT exemption of £11,100 will leave her with a net taxable gain of £28,809 on which she will pay CGT at 18%, £5,185.62.
It would appear that even if your wife got no letting relief, putting her back on the deeds would leave you with a lower CGT liability. This is due to your wife being a basic rate taxpayer.
I hope this helps but let me know if you have any further questions.