There will be no CGT payable on the disposal of the house if it has been his only or main residence throughout the period of ownership.
The value of the house that was sold had increased form approx £40k to £160k. Because he purchased a flat with the funds immediately, no CGT was paid at the time.
Your friend apparently failed to declare a disposal and pay the CGT liability. There is no rollover relief available for non-business assets, so the fact that he used the disposal funds for a replacement property does not remove the CGT liability.
He then wishes to live in the flat.
CGT will arise on the ultimate disposal of the flat, but the gain will be time-apportioned to account for the period of residence. Moving into it at any given point will not change the historic use of the flat and remove the CGT liability. Under current rules lettings relief is also available in respect of a PRR property which has been let as residential accommodation.