Six leds lights up sequence and back by pressing buttonup/down 5 times.

Hoi JKapteijn, en welkom op het forum.

It's clear to me that you are new to all this, and are trying to start understanding how things work.
I think it's a very good idea to do so using the examples that came with IDE, and change those to see what your changes do.
You asked a question about using an if statement, and got some answer using functions in a way that is not documented on this site.
It probably is good C code, but you will have to go somewhere else to find out how this works, and i don't think that's a good idea for someone starting.
And that answer doesn't address your question at all, it offers some way to cut the corner to your end goal, without any explanation at all.

So my answer to your question:
You are going in the right direction, but (of course..):
You are reading to see the "up" button.
Then you are comparing it to the last state, but lastButtonState was only set during initialisation , and never reset.
So you need to set lastButtonState somewhere.
Then, after deciding a new buttonUp press occurred, you are counting up.
Now, while still handling the buttonUp press, you are checking buttonState2 without reading buttonDown.
So buttonState2 will never set to anything but the value that was set during initialisation.

Seems to me you are trying to do too much at once.
You can go this way, but take it step by step.
So first have your sketch count up, then add the down part, but do not try to have both at once.