How to use multiple LEDs

FIRST I just want to turn on RED LED by analog signal, SECOND and when 4 RED LEDs turn on, one green LED turns on.- It should not work when 3 random RED LEDs are applied. GREEN LED works only when 4 RED LEDs are turned on unconditionally.
THIRD I want to operate 4RED LED * 3LINE = 12RED LED = RELAY ON. I want to implement this kind of behavior, but I can't.