Such an expression is often called cardinality constraint.
An overview paper of Carsten Sinz can be found here.
To construct such an expression (or circuit), you basically need a counter/adder and a binary comparator. The comparator compares the sum against the specified constraint(s) and returns true or false respectively.
The counter can be designed in many different styles. There are serial, parallel or mixed counters. The style is chosen according to the requirements. There is a trade-off between gate level depth and number of gates (= Boolean operations).