Explanation
In the example shown, we simply want to "mark" or "flag" rows where the color is "red" AND size is either "small" or "medium". To return TRUE when items are red and small, we can use a logical statement constructed with the AND function:
AND(B6="red",C6="small")
To extend the statement to return TRUE when items are red and either small or medium, we can nest the OR function inside the AND function like this:
AND(B6="red",OR(C6="small",C6="medium"))
This snippet will return TRUE only if the value in B6 is "red" AND the value in C6 is either "small" or "medium". It is placed inside the IF function as the logical test. When the logical test returns TRUE, the IF function returns "x". When the logical test returns FALSE, the IF function returns an empty string ("").
Change the values returned by IF to suit your needs.