There are several issues with your query. Briefly, you cannot leave the max() function without comparing it to some other expression. You also cannot specify the aggregation functions inside the where clause: for that purpose you will need to enclose them into (select max()....) subquery. But for your purpose, where you need to check the sum() and max() over the queried table, you need to specify them in the having as below:
SELECT EmployeeID
FROM orders
GROUP BY EmployeeID
HAVING SUM(debet)=
(SELECT MAX (sum(com)) from orders GROUP BY EmployeeID)
AND COUNT(ledger_id)=
(SELECT MIN(COUNT(EmployeeID)) FROM orders GROUP BY EmployeeID)