Adsorption and gas-sensing properties of ZnO nano-ribbons (ZnO-NRs) in detecting H2 are investigated using density functional theory (DFT) combined with the non-equilibrium Green's function (NEGF) formalism. Several dopants (e.g., C, N and F) have been tested versus adsorption of H2 molecule and other gas molecules (e.g., N2, O2, H2O, H2S). The results of relaxation show the occurrence of chemisorption to occur only in cases of C- and N-doped samples. Selective chemisorption of H2 and O2 molecules are observed on N-doped ZnO-NRs. The chemisorption of O2 is associated with the breaking of just one π-bond. Whereas, the chemisorption of H2 is associated with a complete dissociation and a formation of donor states in the gap (i.e., it yields n-type doping) and has the ability to enhance the conductivity. These characteristics made N-doped ZnO-NRs suitable for high sensitivity and selectivity towards the detection of H2 gas. Furthermore, the calculated IV-curves have paved the way for estimating the sensitivity and consolidated our results. Since the change of conductance is one of the main outputs of sensors, our findings will be useful in developing ZnO-based devices for hydrogen storage and detection.