If a person who owns an HDB flat marries another person who also owns an HDB flat, the couple is required under HDB regulations to dispose of either one of the HDB flats. This regulation applies to the disposal of flats on or after 18 Dec 2015.
If a person owns a non-HDB flat and inherits an HDB flat, they are required under HDB's regulations to dispose of the inherited HDB flat. This exemption also applies to the disposal of flats on or after 18 Dec 2015.
I hope this helps clarify the situation.