As for the colors - it refers to the type of train, normally you'd have no class lights if running an ordinary scheduled freight train. White is an extra, so not scheduled, and green and red are for a scheduled train that has been split into more than one. Let's say you have too much coal to deliver on a scheduled train XYZ, so you have to form three trains, all sharing the number XYZ. The first two would run with green class lights meaning the beginning and continuation of XYZ, and the last train with red ones marking the end of the XYZ train number. As for which ones to turn on, I think it's about the group of locos, so the outer ones are lit (not needed to turn on the ones on hoods facing each other).
Does Canada still use them? They were phased out in the US decades ago, although in most cases the lights weren't removed until the 1990s.