You need to use your formula in a sum function like this:
=SUM(COUNTIFS(A1:A21,{"Apples","Oranges"},B1:B21,">0"))
The reason is, that your function creates an array with the counts of apples and oranges respectively. You have to sum the elements in this array to get your desired result.