Suppose we have the four points $p_1,p_2,p_3,p_4$ with homogeneous coordinates
$$
p_1=\begin{bmatrix}-1 \\ 0 \\ 1\end{bmatrix}, \quad
p_2=\begin{bmatrix}1 \\ 0 \\ 1\end{bmatrix}, \quad
p_3=\begin{bmatrix}0 \\ 2 \\ 1\end{bmatrix}, \quad
p_4=\begin{bmatrix}0 \\ 1 \\ 1\end{bmatrix},
$$
and we want to map $p_1,p_2,p_3$ to themselves but $p_4$ should be mapped to
$$q=\begin{bmatrix}0 \\ -1 \\ 1\end{bmatrix}.$$
This results in a linear equation system of the form
$$
\left\{
\begin{array}{rcl}
Hp_1 & = & \lambda_1 p_1\\
Hp_2 & = & \lambda_2 p_2 \\
Hp_3 & = & \lambda_3 p_3 \\
Hp_4 & = & \lambda_4 q
\end{array}
\right.,
$$
in which there are twelve unknowns (eight from $H$ and four $\lambda_i$) and twelve equations. Solve this system and get
$$H=\frac{1}{3}\begin{bmatrix}3 & 0 & 0 \\ 0 & -1 & 0 \\ 0 & -2 & 3\end{bmatrix}.$$
Note however that you may not in general assume that a given element in $H$ is one just because the scaling is arbitrary, because it may need to be zero.