I will assume that the random variables $X_1, X_2, \cdots , X_n$ are independent,
which condition the OP has not included in the problem statement. With this
assumption, we have that
$$\begin{align}
\operatorname{var}(X_1\cdots X_n)
&= E[(X_1\cdots X_n)^2]-\left(E[X_1\cdots X_n]\right)^2\\
&= E[X_1^2\cdots X_n^2]-\left(E[X_1]\cdots E[X_n]\right)^2\\
&= E[X_1^2]\cdots E[X_n^2] - (E[X_1])^2\cdots (E[X_n])^2\\
&= \prod_{i=1}^n \left(\operatorname{var}(X_i)+(E[X_i])^2\right)
- \prod_{i=1}^n \left(E[X_i]\right)^2
\end{align}$$
If the first product term above is multiplied out, one of the
terms in the expansion cancels out the second product term above.
Thus, for the case $n=2$, we have the result stated by the OP.
As @Macro points out, for $n=2$, we need not assume that
$X_1$ and $X_2$ are independent: the weaker condition
that $X_1$ and $X_2$ are uncorrelated and $X_1^2$ and $X_2^2$
are uncorrelated as well suffices. But for $n \geq 3$, lack
of correlation is not enough. Independence suffices, but
is not necessary. What is required is the factoring of the expectation
of the products shown above into products of expectations, which independence
guarantees.