Given the set $\{1,2,\dots,n\}$, I want to count the number of three-element subsets $\{x,y,z\}$ such that $|x-y|=1$ or $|x-z| = 1$ or $|y-z|=1$. I'm not familiar with how to deal with the "inclusive or" in a counting problem.
As someone pointed out, we can equivalently count the number of triples $\{x,y,z\}$ such that $|x-y|>1$ and $|x-z|>1$ and $|y-z|>1$.
Consider the complement: count the number of three-element subsets $\{x,y,z\}$ $1\leq x<y<z\leq n$ such that $s:=y-x\geq 2$ and $t:=z-y\geq 2$ where $x+s+t\leq n$. It follows that counting the complement is the same as finding the number of non-negative integer solutions of the equation $$A+B+C+D=n-5$$ where $A:=x-1$, $B=s-2$, $C=t-2$. By stars-and-bars, this number is $\binom{n-5+3}{3}=\binom{n-2}{3}$. Hence the answer is $$\binom{n}{3}-\binom{n-2}{3}=(n-2)^2.$$