Under the Right to Buy, at first you had to hold on to the property for five years or - if you sold it - repay in full the discount you had been allowed. Then it was reduced to three years (two for leasehold flats) by a further Housing Act. If you sold sooner, you repaid a proportion of your original discount.
I am in some moral sympathy with the idea that a tenant of many years' standing should be entitled to buy their home. However, what was overlooked was that in many cases the rent for public sector properties had been heavily subsidised, and repairs etc. were normally fully met by the landlord. Some homes were sold for a derisory amount. Tenants would still have been pleased to have the opportunity to buy but at a more realistic price.
I also knew people in the private sector whose landlords had taken rent for up to forty years, and had never been nigh or by their properties, let alone done any repairs. The tenants had often had to pay for everything themselves. It was those people who deserved to be able to buy their homes, but have never had the legal right. Private landlords have never been as regulated as councils and housing associations, and many are still getting away with a lot.