Natural gas accounts for about a quarter of the world's energy consumption; however, most of the current natural gas reservoirs are sour. Sour natural gas containing significant amounts of hydrogen sulfide (H2S) along with carbon dioxide (CO2) must be purified to meet the strict requirements for transportation and storage in the industry. Sour natural gas purification involves two steps: acid gas removal (AGR) and acid gas enrichment (AGE), which currently use highly energy-intensive technologies. Membrane separation represents the most attractive technology to lower the operating cost and carbon footprint of these large processes. Guided by density functional theory (DFT) calculations, we rationally designed a crosslinked poly(ethylene glycol) (PEG) membrane for AGR and AGE applications. Specifically, PEG-bisazide monomers were crosslinked with a novel trialkyne-functionalized H2S-philic melamine via azide-alkyne cycloaddition click chemistry. The developed membranes were characterized and tested for (H2S + CO2)/CH4 and H2S/CO2 separations under realistic industrial conditions, targeting the AGR and AGE applications, respectively. These novel membranes achieved high H2S permeability while maintaining attractive H2S/CO2 selectivity.