Hydrogen resembles halogens in many aspects but which is the most important aspect:-
It's tendency to accept an electron and form a stable configuration
Hydrogen accept 1 electron to have a stable configuration which is similar and most important aspect to halogens.
H+e−→H−
Cl+e−→Cl−