TiO2 has garnered significant attention in the field of photoelectrochemical (PEC) water splitting due to its non-toxicity, cost-effectiveness, and exceptional photochemical stability. However, its practical efficiency in H2 production is greatly hindered by inherent limitations such as low electron mobility, a short carrier diffusion length, and a wide optical band gap. Herein, we present a strategy of combining a crystal phase heterojunction and crystal facet heterojunction to enhance electron–hole separation efficiency in TiO2. The crystal facet heterojunction of rutile TiO2 extends the photogenerated electron lifetime by exploiting discontinuous band gaps and accelerates space charge separation. Moreover, the band alignment between rutile and anatase TiO2 is favorable for electron transfer from rutile to anatase through a phase heterojunction. Consequently, the inverse opal anatase/rutile TiO2 nanorod (IO-TiO2/NRs-TiO2) photoanode affords an excellent hydrogen production rate (682 μmol h−1 g−1), which is 1.6 times higher than that of an inverse opal anatase/rutile TiO2 single heterojunction and 3 times higher than that of inverse opal anatase. This work provides valuable insights into the rational design of photoanodes with a 3D hierarchical structure.