You will need two rules:
First rule for Green:
1) Select your cell B2
2) On the ribbon click Conditional Formatting
3) Click on Highlight Cell Rules, at the top of the dialog box.
4) Click Equals To from the list
5) In the box under the words Format Cells That Are Equal To: Enter the letter X
6) The second box, to the right, should be defaulted to: Light Red Fill with Dark Red Text Click on the drop down arrow, and at the bottom of the drop box and select Custom Format
7) Select the Fill Tab
8) Select Green color
9) Click OK
10) Click OK
Now when cell B2 contains the letter X, it will turn Green.
Think you can work out how to turn cell C2 Red?