A sailboat needs to show red and green sidelights when sailing (no all-around white, as when motoring).
Boats under 20 meters can substitute a tricolor at the top of the mast. (Not a masthead light BTW--that is a steaming light located on the front of the mast, AKA a steaming light. A confusing matter of COLREGS definitions.) The primary advantage when the rule came out is that fewer bulbs and fewer amps were required. Additionally, it can be more visible in waves.