Summation of distinct rows - SQL Server
COUNT() ignores NULL values, and you can use DISTINCT in COUNT() as well.

Try:

  , COUNT(DISTINCT CASE WHEN eep.EepGender='M' THEN eep.eepEEID ELSE NULL END)


(assuming that eep.eepEEID is the unique ID for an employee).

You're doing a unique count of the employee's ID (for males) and NULL (for not males); the NULLs are ignored, and the DISTINCT means that each unique ID will only be counted once.