PCF8574AN configured as output for relay

Yep sitting on my bench now with one light going on one after the other and after the third light goes off the first comes on again.
With the code directly copied from your post with a copy and paste.

what i want to make is to have full control on each output port.

You have it?

i want to switch on some pin. this pin must stay on if the code say so.

That is what your code does.

in the mean time i want have some other pin switched on or off if it is asking in the code.

Just change the number you send to the port. All the bits with a zero in them will turn on. If you want to change one pin without the other then just toggle that bit.
Hang on I will write you a demo.