WHERE can't filter on a count, because when WHERE runs the groups don't exist yet. HAVING filters the groups after they're made, so it can use aggregates. Customers with two or more shipped orders:
SELECT customer_id, COUNT(*) AS shipped
FROM orders
WHERE status = 'shipped'
GROUP BY customer_id
HAVING COUNT(*) >= 2;
Read it in steps: take the orders, keep the shipped ones (WHERE), put them in a pile per customer (GROUP BY), count each pile, and keep the piles of two or more (HAVING).
That's the key to SQL: the order you write a query in isn't the order the database works in. It writes as SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY, LIMIT, but runs like this:
FROM: find the table (and any joins)
WHERE: keep the rows that pass
GROUP BY: make the groups
HAVING: keep the groups that pass
SELECT: work out the result columns
ORDER BY: sort
LIMIT: cut to the first few
It explains a lot. WHERE can't see an aggregate, because the groups come after it. ORDER BY can use a column alias from SELECT, because it runs after SELECT. And you can sort the groups by their aggregate, to find the biggest:
SELECT category, COUNT(*) AS products
FROM products
GROUP BY category
HAVING COUNT(*) > 1
ORDER BY products DESC, category;