Sounds like you need COUNTIFS
function, e.g. this formula will count the number of rows that have "x" in column A and "y" in column B
=COUNTIFS(A:A,"x",B:B,"y")
You can add up to 127 criteria using that format, rows are only counted if all criteria are fulfilled