oh, that's not how we usually derive this, but in any case: all the projectors $P_i = \lvert E_i\rangle\langle E_i\rvert$ commute, their products are zero (orthogonality) and you have $P^k = P$, so for 2 dimensions you'd get $\exp(H) = \exp(E_1P_1 + E_2P_2) = \exp(E_1 P_1)\cdot \exp(E_2 P_2)$ and now $\exp(E_i P_i) = \sum_k \frac{E^k_i}{k!}P_i^k = 1 + \sum_{k >1}\frac{E^k_i}{k!}P_i = 1 + (\exp(E_i) - 1)P_i$. Then
$$ \exp(H) = (1 + (\exp(E_1) - 1)P_1)(1 + (\exp(E_2) - 1)P_2) = 1 + (\exp(E_1) - 1)P_1 + (\exp(E_2) - 1)P_2 = 1 - P_1 - P_2 + \exp(E_1)P_1 + \exp(E_2)P_2$$