The shaded squares are positive because a negative number multiplied or divided by a negative number makes the product or quotient positive. There is no specific rule that comes to mind, but if your teacher has provided a list of specific rules I would look for something mentioning negative numbers.