The correct option is B Hydrogen chloride
Among the given options, in hydrogen chloride molecule, hydrogen and chlorine atoms share one pair of electrons. Hence, it is a covalent molecule.
Magnesium chloride, potassium chloride and sodium chloride are formed by transfer of electrons from one atom to another atom. So, they are ionic compounds.