not sure you can control for two variables at the same time, you need some kind of definition as how you define the classification based on two variables.
Another way is you classify the first var into, for example, 2 groups, and then put each group into 5 groups using the 2nd variable.