Hybrid silica membranes are of great interest for molecular separation owing to their outstanding hydrothermal stability. Despite good separation properties in liquid applications, the selectivity for gas separations has yet been too low. Here, we report membranes from 1,2-bis(triethoxysilyl)ethane (BTESE) with H2/N2 permselectivity between 50 and over 400. The membranes are fabricated from a dip-sol with a H+:Si ratio of 0.01 that is applied onto a support system with a controlled low water content (pre-treated at RH<0.5%). For support systems pre-treated at 90% RH, H2/N2 permselectivities≤10 are obtained, indicating larger pores. The pore formation process is studied in situ by Small-Angle X-ray Scattering in a dedicated setup. The formation of larger pores can be understood by a higher condensation rate and longer drying times when more water is present. This results in a stronger network that better withstands the compressive forces during drying. By limiting both the water and acid contents in the dipped sol, a dense pore structure is obtained that gives the highest H2/N2 and CO2/CH4 permselectivities found to date for hybrid silica membranes. Further variation of the water and acid concentration will allow for additional tuning of the separation properties for both gas and liquid separation.