My SQL is very rusty by now, but I did lots of SQL decades ago. Although I've read all the responses, which are largely based on the concept of correlated queries, I'm going back to your original post.
First, a question: Do you want two separate X and Y counts for each customer, or a combined "X or Y" count for each customer?
If the latter, then I propose:
SELECT custid, count(*) FROM ordertable WHERE (TTL=X or TTL=Y) GROUP BY custid
ORDER BY custid;
If the former, then I propose:
SELECT custid, sum(totx), sum(toty) FROM
(SELECT custid, count(*) as totx, 0 as toty FROM ordertable WHERE TTL=X GROUP BY custid
UNION
SELECT custid, 0 as totx, count(*) as toty FROM ordertable WHERE TTL=Y GROUP BY custid)
GROUP BY custid ORDER BY custid;
If I remember correctly, unions producing a "full select" are automatically unioned with UNIQUE without specifying UNIQUE, but keep in mind that "uniqueness" is across ALL the fields in the SELECT, including aggregates like COUNT and SUM.
Also, in some SQL's, WHERE's in subselects must be HAVING's.
If the above nesting isn't allowed in your SQL, then you'd have to use a temporary table:
CREATE TABLE custcountxy AS
(SELECT custid, count(*) as totx, 0 as toty FROM ordertable WHERE TTL=X GROUP BY custid
UNION
SELECT custid, 0 as totx, count(*) as toty FROM ordertable WHERE TTL=Y GROUP BY custid);
SELECT custid, sum(totx), sum(toty) FROM custcountxy
GROUP BY custid ORDER BY custid;
DROP TABLE custcountxy;
In some SQL's and in some of the above, ORDER BY custid would need to be ORDER BY 1 (1 referring to field #1).