Covalent organic frameworks (COFs) with highly designable skeleton and inherent pores have emerged as promising organic photocatalysts for hydrogen production. However, inefficient solar light harvesting, strong excitonic effect, and the lack of active sites still pose major challenges to the rational design of COFs for efficient photocatalytic water splitting and the structure-property relationship has not been established. In this work, we investigated the fundamental mechanism of photoelectrochemical conversion in fully conjugated donor (D)-acceptor (A) COFs in Lieb lattice and proposed a facile strategy to achieve broad visible and near-infrared absorption, prompt exciton dissociation, tunable band alignment for overall water splitting, and metal-free catalysis of hydrogen production. Interestingly, we found that the exciton binding energy was substantially reduced with the narrowing of optical band gap and the increase of static dielectric constant. Further, we unraveled that the hydrogen bond played a vital role in suppressing the overpotential for hydrogen evolution reaction to enable metal-free catalysis. These findings not only highlight a novel route to modulating electronic properties of COFs towards high photocatalytic activity for water splitting, but also offer tremendous opportunities to design metal-free catalysts for other chemical transformations.