Dont expect anyone on this forum to do your school project for you.
The process you want has input states (from the buttons) and output states (to the leds) so is a good candidate for a state machine.
You can read about state machines with some simple examples here
the code you have is obscure. I have no way of knowing what you expect this to do
if you comment your code properly it will help you understand it.
whereas
digitalWrite(5, HIGH); //turn on green LED
ideally c code should be largely self-explanatory; such as
digitalWrite(GreenLed, ON);