how is the behaviour of hydrogen similar to above 2 groups
Answers
Explanation:
Position of Hydrogen in the Periodic Table
So if you glance at the periodic table, you will see hydrogen is the first element in the table. It is the smallest element on the table. It has atomic number one, which means it has only one electron orbiting it its shell. In fact, Hydrogen has only one shell. It is also the lightest element on the periodic table.
Now we know that the position of elements on the periodic table largely depends on their electronic configuration. Hydrogen has the electronic configuration of 1. It can get rid of one electron to attain noble gas configuration. This characteristic of hydrogen matches those of alkali metals. But they hydrogen atoms can also gain one electron similar to halogens. Let us see how this plays out.

Similarities to Metals
Hydrogen shares many similarities with alkali metals, i.e. elements in group I-A. This is one of the factors that dictates the position of hydrogen in the table. Let us take a look at the similarities
Electronic Configuration: Like all the elements of the group, Hydrogen also has one electron in its last shell, the valence shell. Let us take a look at the composition of valence shells of a few of these alkali metals.
H (z=1) : K1
Li (z=3) : K2, L1
Na (z=11) : K2, L8, M1
Noble Gas Configuration: Like alkali metals, it needs to lose one electron in its valence shell to achieve stable configuration as that of the next noble gas, which in this case is helium. It hence forms the H+ ion.
Good Reducing Agent: Hydrogen is a strong reducing agent like all the other alkali metals.
Fe2O3 + 4 H2 → 3Fe + 4H2O
B2O3 + 6 K → 2B + 3 K2O
Forms Halides: Also just like alkali metals, hydrogen combines with electronegative elements to form halides
2Na + Cl2 → 2NaCl
H2 + Cl2 → 2HCl