It makes a difference whether you mean "exactly two must be true" versus "at least two must be true".
For the set of variables {A..F}, the responses by Pax and Charlie Martin covered the "exactly two" situation (two are true and the rest are false), while the expression in your question seemed to deal with the "at least two" case:
(A && B) || (A && C) || ... || (D && E) || (D && F) || (E && F)
is an expression that is true when, for example, A and B are true and the remaining variables are anything (true or false).
If what you're asking for is a set-theory-like expression to describe the situation(s) above, you might express it something like this:
#{x | x <- {A, B, C, D, E, F} | x} = 2
where the notation works this way:
#{...}
represents the size of the enclosed set, and the set itself:
{x | x <- {A, B, C, D, E, F} | x}
reads "the set of x
, where x
is one of A
through F
, and x
is true". In other words given the set of variables A
through F
, the subset made up of the variables with true values has exactly two elements. (Use <=
instead of '=' to express the other interpretation of your question.)