The whole expression is classified based on the highest exponent it contains.
The given polynomial is:
x^2y + 7xy + xyz + z
The term with the highest power is x^2y^1
The total power of the exponent is 3.
This means that this expression is a 3rd degree polynomial with 4 terms.
Hope this helps :)