Spin Hamiltonian and hole excitations in the Emery model