Express product in ILP
It depends on $x$ being bounded or not.

Suppose that $x$ is bounded as $x\in[0,x_{\mathrm{max}}]$. Then, the constraint $z=xy$ can be written as:
$$
\begin{cases}
z\leq x_{\mathrm{max}} y,\\
z\leq x,\\
z\geq x-(1-y)x_{\mathrm{max}},\\
z\geq 0.
\end{cases}
$$

You easily see that:


if $y=0$, then $z=0$; and
if $y=1$, then $z=x$.