Producing hydrogen through freshwater or urea-containing wastewater electrolysis using renewable electricity requires multifunctional catalysts made from nonprecious metals. In the current study, we disclose the rational fabrication of oxide/phosphide heterostructure nanorods with rare earth metal doping on nickel foam (NF), denoted Ce-NiCoP/Co3O4/NF, via partial phosphorization. Benefiting from intrinsic interface formation and doping effects, the interaction between the coupling components facilitates electron transfer, optimizing the electronic configuration of the Ce-NiCoP/Co3O4/NF catalyst. Ce-NiCoP/Co3O4/NF exhibited a competitive potential of − 0.151 V for hydrogen evolution reaction, 1.50 V for oxygen evolution reaction (OER), and 1.33 V (versus reversible hydrogen electrode) toward urea oxidation reactions (UOR) at 100 mA cm−2. In situ Fourier-transform infrared combined with electrochemical analysis detects *OOH and *O2− intermediates in OER, as well as CO32− and CNO− ions, alongside the N–H vibration in UOR, providing deeper insight into the OER and UOR mechanisms on the Ce-NiCoP/Co3O4/NF. More importantly, the catalyst exhibited an activity of 20 mA cm−2 requiring voltages as low as 1.52 V for unassisted water splitting and 1.27 V for urea-assisted electrolysis.