Microgrids are small-scale power systems with local generation, storage systems and load demands, that can operate connected to the main grid or islanded. In such systems, optimal components sizing is necessary to make the system secure and reliable, while minimizing costs. In this paper, a stand-alone microgrid considering electric power, cooling/heating and hydrogen consumption is built. A unit commitment algorithm, formulated as a mixed integer linear programming problem, is used to determine the best operation strategy for the system. A genetic algorithm is used to search for the best size of each component. The influence of three factors (operation strategy, accuracy of load and renewable generation forecasts, and degradation of fuel cell, electrolyzer and battery) on sizing results is discussed. A 1-h rolling horizon simulation is used to check the validity of the sizing results. A robust optimization method is also used to handle the uncertainties and evaluate their impact on results.