Equipping microgrids with electrolysers which convert renewable energy sources (RESs) into hydrogen for storage is anefficient approach to enhancing RES consumptions. This requires rational power allocation among controllable devices,such aselectrolysers,electrochemical energy storage systems and fuel cells,within microgrids so as to mitigate the impacts of RES fluctuations onsystem economics and stability as well as equipment safety. Since the membrane of electrolysers cannot completely separate the productionof hydrogen and oxygen,the proportion of gas crossover will accumulate,especially during low-load operation,and might eventuallyexceed the maximum allowable limit and cause explosion. Therefore,the lower operating limits of electrolysers must be taken into accountto allocate power between electrolysers and other components within microgrids. Constant lower power limits are usually specified forelectrolysers to ensure their safe operation. However,the use of constant lower limits for electrolysers has certain limitations since theoperating conditions of microgrids together with electrolysers dynamically change over time. A constant lower limit would be tooconservative to exploit the ability of an electrolyser to absorb RESs,and sometimes may fail to prevent excessive crossover when anelectrolyser operates at low loads for long time. In addition,microgrids typically incorporate both alkaline electrolysers (AELs) andproton exchange membrane (PEM) electrolysers,which exhibit distinct gas crossover characteristics. This further increases the complexity of microgrid scheduling due to the fact that lower power limits must be set for each electrolyser type separately. To addressthese challenges,this paper first establishes dynamic safety constraints for AEL and PEM electrolysers based on a comprehensive analysisof their operational characteristics. Then,a microgrid scheduling method is proposed to maximise the overall benefits from hydrogenproduction and electricity price arbitrage by optimising power allocation to a photovoltaic plant,battery energy storage system,fuel cell,AEL and PEM electrolysers subject to the safety constraints. Simulation results demonstrate that,compared with traditional schedulingmethods that adopt constant lower limits for electrolysers,the proposed approach effectively ensures dynamic safety of electrolysers interms of gas crossover,providing a novel framework for the scheduling of hydrogen-based microgrids.