That's Conditional Formatting.

For row 2, the first condition would be: =$C2=1, second condition: =$C2=2, and third: =$C2=3.

Select all cells from A2 down to G whatever before applying the CF

Regards