The central objective of this study is to improve the understanding of flow behaviour during hydrogen (H2) storage in subsurface porous media, with a cushion gas of carbon dioxide (CO2). In this study, we investigate the interactions between various factors driving the flow behaviour, including the underlying permeability heterogeneity, viscous instability, and the balance between the viscous and gravity forces. In particular, we study the impact of CO2 solubility in water on the level of H2 purity. This effect is demonstrated for the first time in the context of H2 storage. We have performed a range of 2D vertical cross-sectional simulations at the decametre scale with a very fine cell size (0.1 m) to capture the flow behaviour in detail. This is done since it is at this scale that much of the mixing between injected and native fluids occurs in physical porous media. It is found that CO2 solubility may have different (positive and negative) impacts on the H2 recovery performance (i.e., on the purity of the produced H2), depending on the flow regimes in the system. In the viscous dominated regime, the less viscous H2 may infiltrate and bypass the cushion gas of CO2 during the period of H2 injection. This leads to a quick and dramatic reduction in the H2 purity when back producing H2 due to the co-production of the previously bypassed CO2. Interestingly, the impurity levels in the H2 are much less severe in the case when CO2 solubility in water is considered. This is because the bypassed CO2 will redissolve into the water surrounding the bypassed zones, which greatly retards the movement of CO2 towards the producer. In the gravity dominated scenario, H2 accumulates at the top of the model and displaces the underlying cushion gas in an almost piston-like fashion. Approximately 58% of H2 can be recovered at a purity level above 98% (combustion requirements by ISO) in this gravity-dominated case. However, when CO2 solubility is considered, the H2 recovery performance is slightly degraded. This is because the dissolved CO2 is also gradually vaporised during H2 injection, which leads to an expansion of mixing zone of CO2 and H2. This in turn reduces the period of high H2 purity level (>98%) during back-production.