Now I grant you, first you have to GET hydrogen. Usually, that means making it. You can split water into O2 and H2, but you are simply reversing the combustion process, so this can't be done perpetually. Energy has to come from somewhere else. Some would say that H2 isn't really a source of energy, but rather a carrier to it. One could probably use the same arguement with electricity.
But if you are going to use electricity to make hydrogen to burn in a car using an ICE, or make electricity from a hydrogen fuel cell, you might as well just use the electricity directly. However H2, even when created by electricity elsewhere can be quickly replenished into the car much like gasoline, whereas to charge up a car takes considerable time. Much more than 5 minutes it takes to fill up a gasoline tank in a car.
One could also extract H2 from fossil fuels, usually natural gas. But that is not renewable.
Ultimately, almost all mass forms of energy that we have on earth came from the sun, whether it is directly, stored in plants that grew in the sun and then converted to fuel, plants eaten by animals that were then converted to fuel (blubber for example), or plants that were eaten by animals that died and fossilized and became petroleum, or the sun caused air and water disturbances that can be harnessed.
Even lightning ultimately comes from the sun. Lighting is caused by rainfall, which is caused by condensed water vapor that was made into vapor from liquid water that evaporated from the heat of the sun.