This study addresses the energy management of an integrated solar-hydrogen microgrid. The microgrid includes zero-emission vehicles, renewable energy sources, an electrolyzer, bidirectional charging stations, and a hydrogen refueling station with hydrogen storage. Vehicle-to-grid (V2G) charging stations can alleviate renewable electricity variability by discharging the energy of vehicle batteries back to the grid. The electrolyzer can absorb excess solar generation to balance supply and demand with power-to-gas (P2G) transactions. Given the uncertainties from intermittent renewable generation and energy demand, a two-stage stochastic optimization framework derives the optimal power management strategy for the component subsystems, aiming to minimize operating costs. The first stage of the model determines the day-ahead charging price and power supply for electric vehicle charging and hydrogen production, and the second stage performs real-time energy scheduling under different scenarios. The performance of the proposed optimization strategy is examined through a case study using real-world data, and the results demonstrate that daily operating costs can be reduced by up to 27.5%. Moreover, inclusion of the P2G process with hydrogen storage yields better performance to support peak shaving and reducing costs compared to using V2G or dynamic pricing-based demand response policies only.