Hydrogen is difficult and expensive to store, not only for the reasons given above, but because it will leak through almost any material including steel of a useful thickness, with the problem exacerbated by pressure. Since hydrogen is flammable over a very wide range of proportions with air, this leakage is a severe safety hazard.
About 99% of hydrogen produced today is via a not particularly energy efficient process from natural gas. It can be produced by electrolysis from water with the only byproduct being oxygen, but this process is energy inefficient and the hydrogen produced is much more expensive that from natural gas. From renewable electricity sources to the wheels of an electric car is probably about twice the energy efficiency of going from the same renewables to the wheels of a hydrogen car.
These problems can be surmounted when the problem cannot be solved using batteries, as with long distance haulage, but there is zero evidence that hydrogen will ever become competitive with batteries for private cars.

