When one condition isn't enough, use the plural versions. Every condition must be true for a row to count.
=SUMIFS(sum_range, criteria_range1, criteria1, criteria_range2, criteria2, ...)
=COUNTIFS(criteria_range1, criteria1, criteria_range2, criteria2, ...)
Note the order in SUMIFS: the range to add comes first, then the pairs of range and condition. That's the opposite of SUMIF, where the sum range comes last, so check the order whenever you switch between them.
All the ranges must be the same size, or SUMIFS returns #VALUE!. Criteria follow the same rules as COUNTIF: text and comparisons in quotes, cells without quotes.
AVERAGEIFS, MAXIFS and MINIFS work the same way as SUMIFS.