You may apply to column B conditional formatting rule for the green with formula
assuming your range starts from first row. Similar for the red rule.
It works for your entire range
Please see attached