Atmospheric characterization has been a powerful tool to understand the chemical and physical properties of close-in gas giant exoplanets. However, limited wavelength coverage and precision from previous observations have provided inconsistent and ambiguous results. Using the JWST Near Infrared Camera (NIRCam), we detected H2O (10 sigma), CO2 (26 sigma), CO (6 sigma), and H2S (7 sigma) in the transmission spectrum (2.4-5 micron) of the archetype hot Jupiter HD 189733b. With an equilibrium temperature of ~1200K, H2O, CO, and H2S are the main reservoirs for oxygen, carbon, and sulfur in a H2-dominated atmosphere. The corresponding inferred atmospheric metallicity is 3-5 times stellar. Methane is found to be depleted to below 0.01 ppm and provides strong evidence for a low carbon-to-oxygen ratio (<0.2), indicating a formation history of accreting water-rich icy planetesimals. The low C/O inference remains robust even considering the effects of photochemistry and vertical mixing. The detection of H2S, combined with the non-detection and strict upper limits for its photochemical product SO2, provide valuable constraints on atmospheric metallicity and photochemical processes that occur on highly irradiated hot Jupiters.