Two Endogenous Variables and Two Instruments
I don't think you need anything like a 3SLS. Just run the first stage for the two endogenous variables separately:

$$\tilde{X}=\alpha_1+\beta_1X'+\beta_2Y'+\beta_3C+\epsilon$$
$$\tilde{Y}=\kappa_1+\gamma_1X'+\gamma_2Y'+\gamma_3C+\delta$$

Then run a regression of Z on the predicted value of $\tilde{X}$, $\tilde{Y}$ as and $C$. If the assumptions are all satisfied, this should give a consistent estimate of the coefficients.

I also found this thread online. It might be helpful.
https://www.stata.com/statalist/archive/2012-08/msg01238.html