Current research has validated the purification of rainwater by a substrate layer of green roofs to some extent, though the effects of the substrate layer on rainwater purification have not been adequately quantified. The present study set up nine extensive green roof experiment combinations based on the current conditions of precipitation characteristics observed in Shanghai, China. Different rain with pollutants were simulated, and the orthogonal design L9 (33) test was conducted to measure purification performance. The purification influences of the extensive green roof substrate layer were quantitatively analyzed in Shanghai to optimize the thickness, proportion of substrate, and sodium polyacrylate content. The experimental outcomes resulted in ammonium nitrogen (NH4+-N), lead (Pb), and zinc (Zn) removal of up to 93.87%, 98.81%, and 94.55% in the artificial rainfall, respectively, and NH4+-N, Pb, and Zn event mean concentration (EMC) was depressed to 0.263 mg/L, 0.002 mg/L and 0.018 mg/L, respectively, which were all well below the pollutant concentrations of artificial rainfall. With reference to the rainfall chemical characteristics of Shanghai, a combination of a 200 mm thickness, proportions of 1:1:2 of Loam: Perlite: Cocopeat and 2 g/L sodium polyacrylate content was suggested for the design of an extensive green roof substrate to purify NH4+-N, Pb and Zn.