Converting solar energy into hydrogen gas by water splitting is considered as a long-term solution to address global energy and environmental problems. Great effort has been devoted to the search for abundant systems for the purpose of efficient capture, conversion, and storage of solar energy in a cost-effective manner. To further advance the recently-developed carbon nitride photocatalysis for solar hydrogen generation, thiourea, a sulfur-containing compound, was used as a cheap and easily-available starting material for the synthesis of graphitic carbon nitride semiconductors. The as-prepared photocatalysts were subjected to several characterizations, and the results showed that the heating temperature and the presence of sulfur motifs offer a facile chemical pathway for the control of the condensation/polymerization of carbon nitride, and thus adjusting their textural and electronic properties. Photocatalytic activity experiments demonstrated that the g-C3N4 synthesized from thiourea exhibited a much higher H2 production rate than that of g-C3N4 prepared from dicyanamide or urea, and this activity can be further enhanced by increasing the condensation temperature.