Environmentally regulated gene expression is critical for bacterial survival under stress conditions, including extremes in temperature, osmolarity and nutrient availability. Here, we dissect the thermo- and osmo-responsory behavior of the transcriptional repressor H-NS, an archetypal nucleoid-condensing sensory protein, ubiquitous in enterobacteria that infect the mammalian gut. Through experiments and thermodynamic modeling, we show that H-NS exhibits osmolarity, temperature and concentration dependent self-association, with a highly polydisperse native ensemble dominated by monomers, dimers, tetramers and octamers. The relative population of these oligomeric states is determined by an interplay between dimerization and higher-order oligomerization, which in turn drives a competition between weak homo- versus hetero-oligomerization of protein-protein and protein-DNA complexes. A phosphomimetic mutation, Y61E, fully eliminates higher-order self-assembly and preserves only dimerization while weakening DNA binding, highlighting that oligomerization is a prerequisite for strong DNA binding. We further demonstrate the presence of long-distance thermodynamic connectivity between dimerization and oligomerization sites on H-NS which influences the binding of the co-repressor Cnu, and switches the DNA binding mode of the hetero-oligomeric H-NS:Cnu complex. Our work thus uncovers important organizational principles in H-NS including a multi-layered thermodynamic control, and provides a molecular framework broadly applicable to other thermo-osmo sensory proteins that employ similar mechanisms to regulate gene expression.