Hydrogen has a lower BTU than gasoline or diesel. It's odorless, which means that, like natural gas, you can't smell a leak, and why it would need an additive to give it a smell. Burning colorless means that it's possible to move a hand or even walk into a hydrogen flame without knowing it's there, which is why it would also need an additive to give it color.
Since hydrogen is a gas, it doesn't day in one place, and while it's lighter than air, air is a fluid that swirls and whirls and well, behaves like a fluid. It would tend to collect up under any sort of overhang, keeping in mind that air is a fluid. Hydrogen atoms are also exceptionally tiny, and will ooze right through some materials (Helium will, too). In a high enough concentration as it swirls around, given a spark or flame it will combust. I wouldn't recommend naming a hydrogen vehicle company Hindenburg Motors.
Gasoline vapors also act as a fluid. They would tend to collect down in something, though keep in mind air is a fluid. In a high enough concentration, it will combust given a spark or flame. Its molecules are larger than hydrogen atoms. More importantly, it's liquid under normal temperatures.
Here is where we get to the big problem: Stored hydrogen is a gas under pressure. This is what caused the issue with bottled gas with that incident in Canada in the 1970s that I only hazily recall. The bus used either natural gas or propane, and in the accident, it was the tank rupturing that caused the tragedy. If I remember it correctly (big if), the victims were likely killed by the force of the rupture before the gas combusted. There was research in the 1970s of making a hydrogen tank out of a sort of metal sponge to lessen rupture problems in a crash, but don't recall how far that came along. The point is that a ruptured tank of a gas under pressure presents issues beyond the gas contained inside the tank.
When a gasoline tank ruptures, since it's under no or slight pressure, you end up with a hole or rip in the tank and gasoline leaking, but the force of the rupture doesn't present a problem as it does with any gas under pressure. The leaking gasoline presents a problem, and if the vapor has a spark or a flame, it will combust, just like hydrogen.
The gas under pressure problem is more significant than many think. In the 1970s there was serious effort to move to natural gas or propane to power vehicles due to availability, and remember articles on converting vehicles to natural gas. It might have caught on had it not been for the issue of what happens if the tank ruptures.