There are 3 cases.
Case 1: The families occupy $1$ house.
There are $n$ ways to choose the land to build the occupied house.
For the remaining $n-1$ lands, a house can be built or not to be built, so there are $2^{n-1}$ ways.
Hence, there are $n\cdot 2^{n-1}$ ways for Case 1.
Case 2: The families occupy $2$ houses.
There are $n$ ways to choose the land to build the occupied house for $2$ families and then there are $n-1$ ways to choose the land to build the occupied house for $1$ family.
Then there are ${3 \choose 2}=3$ ways to choose $2$ families for the occupied house for $2$ families and the remaining $1$ family for the occupied house for $1$ family.
For the remaining $n-2$ lands, a house can be built or not to be built, so there are $2^{n-2}$ ways.
Hence, there are $n(n-1)\cdot 3\cdot 2^{n-2}=3n(n-1)\cdot 2^{n-2}$ ways for Case 2.
Case 3: The families occupy $3$ houses.
There are $n$ ways to choose the land to build the occupied house for the $1$st family, then there are $n-1$ ways to choose the land to build the occupied house for the $2$nd family and there are $n-2$ ways to choose the land to build the occupied house for the $3$nd family.
For the remaining $n-3$ lands, a house can be built or not to be built, so there are $2^{n-3}$ ways.
Hence, there are $n(n-1)(n-2)\cdot 2^{n-3}$ ways for Case 3.
Combining the 3 cases
\begin{align*}
\text{The total number of ways} & =n\cdot 2^{n-1}+3n(n-1)\cdot 2^{n-2}+n(n-1)(n-2)\cdot 2^{n-3} \\
& =n[4+6(n-1)+(n-1)(n-2)]\cdot 2^{n-3} \\
& =n^2(n+3)\cdot 2^{n-3} \\
\end{align*}