The following naive generalization might be useful:
\begin{equation}
1 - \sum_\limits{i=1}^{n}x_i + \sum\limits_{\substack{\{j,k\}\in \{1,...,n\}^2\\ j\not=k}} x_j x_k
\end{equation}
If all variables are set to $0$, this expression has a value of $1$. If one or two variables are set to $1$, the expression's value is $0$. If $m>2$ variables are set to $1$, its value is $1-m+$$m \choose 2$. Since $m \choose 2$$\ge m$, the expression's value is at least $1$. Thus, minimizing this expression guarantees that at least one variable is set to $1$. Nevertheless, it also forces your solution to have less than three variables set to $1$, i.e., $\sum\limits_{i=1}^n x_i \le 2$. You could partition your set of variables to avoid the effect of this last extra constraint.
For instance,
\begin{equation}
1-x_1-x_2-x_3+x_1x_2+x_1x_3+x_2x_3
\end{equation}
equals 1 when $x_1=x_2=x_3=1$. Thus, such assignment of values is unfeasible, i.e., it does not correspond to the minimum value of 0.