The evolution of cost-effective hydrogen evolution reaction (HER) electrocatalysts is of great significance for the development of clean energy. Exploring effective synthesis strategies to optimize the performance of non-noble metal electrocatalysts has always attracted our attention. Herein, ultrathin coordination polymers were used as precursors to controllably synthesize two-dimensional (2D) ultrathin dual-phase transition metal selenide (TMSs)/carbon-nitrogen (CN) composites (CoSe2-NiSe2/CN) by a two-step method (first a low temperature hydrothermal method for selenization, and then high temperature calcination selenization). Benefiting from its large specific surface area (49 m2 g-1), abundant catalytically active sites and synergistic effects, CoSe2-NiSe2/CN can significantly enhance the HER catalytic activity and exhibits good electrocatalytic activity with an overpotential of 150 mV at -10 mA cm-2, and a small Tafel slope of 42 mV dec-1 in an acidic electrolyte for the HER. This work provides a new strategy for optimizing the HER catalytic activity of TMSs by preparing 2D ultrathin dual-phase TMS composite materials.