This can be done in excel but looking at other similar questions it would appear that what you want is not possible in google sheets.
There was one suggestion of using =COUNTA(FILTER(range = criteria)) but it wasn't clear from the post if that would work with rows being filtered or if it was an alternative.
Another suggestion was to use additional column filters so that only data meeting all of the criteria in the formula would be visible, then subtotal the remaining rows.