Atomic hydrogen (H i) gas, mostly residing in dark matter halos after cosmic reionization, is the fuel for star formation. Its relation to the properties of the host halo is the key to understand the cosmic H i distribution and to mock H i large scale structure accurately and conveniently for the large area H i intensity mapping surveys in the future. In this work, we propose a flexible empirical model of H i–halo relation. In this model, while the H i mass depends primarily on the mass of host halo, there is also secondary dependence on other halo properties. We apply our model to the observation data of the Arecibo Fast Legacy ALFA (ALFALFA) survey, and find it can successfully fit the cosmic H i abundance (ΩH I), average H i–halo mass relation 〈MH IMh〉, and the H i clustering. The best fit of the ALFALFA data rejects the model with no secondary halo dependence of H i and the model with secondary dependence on the halo spin parameter (λ), and shows a strong dependence on halo formation time (a1/2) and halo concentration (cvir). In an attempt to explain these findings from the perspective of hydrodynamical simulations, the IllustrisTNG simulation confirms the dependence of H i mass on secondary halo parameters. However, the IllustrisTNG results show a strong dependence on λ and a weak dependence on cvir and a1/2, and also predict a much larger value of H i clustering on large scales than observations. This interesting difference between simulation and observation calls for improvements in understanding the H i–halo relation from both theoretical and observational sides.