The following code can be used to find the monomials that have some exponent that has degree 2 or all exponents of 1 or 0. Hopefully, this is what you're looking for (and you can adapt it to your use case).
-- Set up the ring
R = QQ[x,y,z]
-- A list of monomials, similar to the problem
L = {x*y*z^2,x*y*z,x*y,z^2,x^3*y^2}
-- For each monomial in L, first compute the exponents
-- Search the exponents and select all 2's
-- If there is at least one 2 in the list of exponents, then select that element
select(L,i->(E = flatten exponents i;T = select(E,i->i==2);if #T > 0 then true else false))
-- For each monomial in L, first compute the exponents
-- Search the exponents and any instances where the exponent is not 1
-- If there is at least one entry of the exponent that's larger than one, then do not select that element
select(L,i->(E = flatten exponents i;T = select(E,i->i>1);if #T > 0 then false else true))