Porous carbons are considered promising for CO2 capture due to their high-pressure capture performance, high chemical/thermal stability, and low humidity sensitivity. But, their low-pressure capture performance, selectivity toward CO2 over N2, and adsorption kinetics need further improvement for practical applications. Herein, we report a novel dual-templating strategy based on molten salts (LiBr/KBr) and hydrogen-bonded triazine molecules (melamine–cyanuric acid complex, MCA) to prepare high-performance porous carbon adsorbents for low-pressure CO2. The comprehensive investigations of pore structure, microstructure, and chemical structure, as well as their correlation with CO2 capture performance, reveal that the dual template plays the role of porogen for multi-hierarchical porous structure based on supermicro-/micro-/meso-/macro-pores and reactant for high N/O insertion into the carbon framework. Furthermore, they exert a synergistic but independent effect on the carbonization procedure of glucose, avoiding the counter-balance between porous structure and hetero-atom insertion. This enables the preferred formation of pyrrolic N/carboxylic acid functional groups and super-micropores of ~ 0.8 nm, while retaining the micro-/meso-/macro-pores (> 1 nm) more than 60% of the total pore volume. As a result, the dual-templated porous carbon adsorbent (MG-Br-600) simultaneously achieves a high CO2 capture capacity of 3.95 mmol g−1 at 850 Torr and 0 °C, a CO2/N2 (15:85) selectivity factor of 31 at 0 °C, and a high intra-particle diffusivity of 0.23 mmol g−1 min−0.5 without performance degradation over repeated use. With the molecular scale structure tunability and the large-scale production capability, the dual-templating strategy will offer versatile tools for designing high-performance carbon-based adsorbents for CO2 capture.