Photocatalyst with multiple modification sites (MSs) exhibited better performance than single site in photocatalytic H2O2 evolution, while the corresponding reaction mechanism is more complicated. However, neither experiment nor density functional theory (DFT) based on ground state wavefunction cannot precisely confirm the role of each site in photocatalyst with multiple MSs. Here, we propose a universal method that flexibly combines experiments, DFT and time-dependent DFT (TDDFT) calculations to reveal the photocatalytic mechanism and active site of nitrogen deficiency g-C3N4 (NDCN) containing two MSs (bicoordinated nitrogen vacancy and cyano group). Characterization techniques and control experiments prove that generation of H2O2 on NDCN is a two-step single electron transfer process, and NDCN exhibits enhanced charge separation efficiency and higher selectivity for two-electron oxygen reduction. DFT-TDDFT calculations further indicate that nitrogen vacancy is the real catalytic site for activating O2, which promotes O2 adsorption and continuously formation of •O2−, thus inhibiting electron-hole recombination.