hydrogen is weight optimized but very volume inefficient. Gasoline is volume optimized but weight inefficient.. both types of fuels have their place for diffent types of engines, but generally gasoline is more useful for most things.
That said you can do some magic with metal hydrides to store hydrogen in a volume compact way, but thats another topic.