Assume we have (target) random variables $Y_1$ and $Y_2$ are conditionally independent on $X_1,\ldots,X_n$. Then:
$$p(Y_1,Y_2, X_1,\ldots,X_n) = p(Y_1| X_1,\ldots,X_n) \cdot p(Y_2| X_1,\ldots,X_n)\cdot p(X_1,\ldots,X_n) $$
I am trying to derive a similar result for the case when target variables are conditioned on different variables, i.e. we know $p(Y_1| X_1,\ldots,X_n)$ and $p(Y_2| X_1 ',\ldots,X_m ')$ and would like to write:
$$p(Y_1,Y_2, X_1,\ldots,X_n) = p(Y_1| X_1,\ldots,X_n) \cdot p(Y_2| X_1',\ldots,X_m')\cdot p(X_1,\ldots,X_n,X_1',\ldots,X_m') $$
I think these assumptions make it work. can we simplify them more?
$Y_1$ and $Y_2$ conditionally independent on $ X_1,\ldots,X_n,X_1',\ldots,X_m'$;
$Y_1$ and $X_1',\ldots,X_m'$ conditionally independent on $X_1,\ldots, X_n$ and
$Y_2$ and $X_1,\ldots,X_n$ conditionally independent on $X_1',\ldots, X_m'$
As a side question, would it even make sense to say that $Y_1| X_1,\ldots,X_n$ and $Y_2| X_1',\ldots,X_m'$ are independent, or is it necessary to condition on the same r.v?
Your first definition of the conditional independence of $Y_1$ and $Y_2$ given $X_1, ..., X_n$ is wrong. It should be:
$p(Y_1, Y_2 | X_1, ..., X_n) = p(Y_1, |X_1, ..., X_n) . p(Y_2, |X_1, ..., X_n) $.
Conditioning on an event is equivalent to a new universe where that event is known to have occurred. Therefore, if you condition on two different events (or different sets of rvs in your case), you are necessarily operating in different universes. So I don't think it makes sense to relate "$Y_1|X_1, ..., X_n$" and "$Y_2 | X_1', ..., X_n'$".