Not sure what x^y^2 was supposed to be in your polynomial f. Anyway, try something like this.
sage: R.<x,y> = PolynomialRing(ZZ, order='deglex')