We propose a mechanism for binding of diatomic ligands to heme based on a dynamical orbital selection process. This scenario may be described as bonding determined by local valence fluctuations. We support this model using linear-scaling first-principles calculations, in combination with dynamical mean-field theory, applied to heme, the kernel of the hemoglobin metalloprotein central to human respiration. We find that variations in Hund's exchange coupling induce a reduction of the iron 3d density, with a concomitant increase of valence fluctuations. We discuss the comparison between our computed optical absorption spectra and experimental data, our picture accounting for the observation of optical transitions in the infrared regime, and how the Hund's coupling reduces, by a factor of five, the strong imbalance in the binding energies of heme with CO and O_2 ligands.