Hydrogen is not an energy source but an energy carrier that can be used to store and transport energy.
Hydrogen is therefore secondary energy since primary energy must first be used for its production in all production methods. Combined with renewable energy sources (like solar or wind energy) Hydrogen is the solution to have a constant source of green energy with zero emissions.