The separation of hydrogen from other weakly adsorbing gases is a topic of high industrial relevance. Microporous materials, such as zeolites, metal–organic frameworks (MOFs), and nanoporous molecular crystals, hold much promise as adsorbent materials for adsorption-based hydrogen separation units. However, most experimental and theoretical studies that have been reported so far have focused on relatively few gas mixtures (mainly CO2/H2 and CH4/H2). In this work, the suitability of five materials (zeolite: silicalite; MOFs: Mg-formate, Zn(dtp), Cu3(btc)2; porous molecular crystal: cucurbituril) for the adsorption-based separation of carbon monoxide/hydrogen and oxygen/hydrogen mixtures is assessed using force-field based grand-canonical Monte Carlo simulations. The simulations are employed to predict single-component and mixture isotherms, as well as adsorption selectivities. Moreover, a detailed analysis of the solid-fluid interactions is carried out on an atomistic level. The choice of materials is motivated by their structural properties: four systems contain relatively narrow channels (diameters < 6.5 Å), but differ in pore wall composition and polarity. The fifth system possesses coordinatively unsaturated metal sites, which can act as preferential adsorption sites for some guest molecules. The role of electrostatic interactions is fundamentally different for the two mixtures considered: for CO/H2 separation, the employment of polar adsorbents is beneficial due to the enhanced electrostatic interaction with carbon monoxide. On the contrary, an increased polarity of the pore wall tends to reduce the O2/H2 selectivity, because electrostatic interactions favour hydrogen over oxygen due to its larger quadrupole moment. In general, materials with narrow channels perform best in the separation of hydrogen from weakly adsorbing species, because the dispersive interactions are maximized in the channels. Moreover, they provide little space for the co-adsorption of hydrogen.