Correlated photon emission by two excited atoms in a waveguide