The right hand side of a where can ONLY use a constant, not a variable or other object. Try this post for a more thorough explanation and a workaround.
Adding additional types of conditions on the “where” clause can be a bit tricky, but there are many examples either here or on the web. The bottom line is that the “where” clause will only work with = and only with a constant on the right side of the expression. So you simply make up a new variable that has all of your logic, then reference that variable in your where clause.