To convert CO2 and water into organic chemicals via photoelectrocatalytic (PEC) reduction of CO2 under mild conditions is considered to be one of promising methods to address a series of problems like climate change and energy crisis caused by over-emission of CO2. Herein, the organic-inorganic heterojunctions were designed and fabricated by using organic h-BN and inorganic NiCo2O4 as precursors. The optimal NiCo2O4@h-BN-6 heterojunction exhibited impressive performance in CO2 reduction, yielding C2+ chemicals with 100 % selectivity in a rate of 28.5 μM cm−2 h−1. This phenomenon is attributed to the structural feature of three active sites of nitrogen in a unique hexacycle like benzene, which benefit the carbon-carbon coupling among the intermediates. The first observed *N-H species suggest that the N sites can adsorb protons and electrons and convert them into highly active hydrogen atoms. The verification experiments demonstrate that the material will oxidize intermediates to acetic acid where boron atoms are presented as holes in semiconductor. The isotopic labeling experiments of 13CO2 and H218O verified that the products were derived from CO2 and water. The key active intermediates such as *CHO, *=CO, and *COCHO in the synthetic process of C2+ products had been confirmed by operando FTIR spectra and DFT calculations.