It is because it has 1 valence electon like alkaline earth metals and they are also diatomic and form covalent bonds like halogens ...... It can also gain and loose electrons so due to all the above reasons hydrogen need a special position in a periodic table
Because Hydrogen is the first element of the periodic table. Its atomic number is 1, which indicates the presence of only one electron in the atom of hydrogen. This electron is present in its first shell. Hydrogen resembles both alkali metals (group I A) as well as halogens (group VII A) therefore its position is said to be anomalous.