Hydrogen resembles like both alkali metals and halogens.
Hydrogen has only one electron in its outermost shell.This is similar to that of the alkali metals. At the same time, most of the chemical properties of hydrogen resembles that of halogens. So it is similar to both. Hence hydrogen was given an ambiguous position.