Russia has said that under article 51 part 7 they went into the Ukraine to defence the Russian citizens, having been asked to go in by the Russian citizens. The point here in fact is that they are saying they want to comply with international law and article 51 part 7 says it is legitimate until the UN takes measures. So this is an opening for the UN to negotiate peace keeping measures. I hope that makes sense now.
Please go back and read Article 51. Russia's invasion is NOT legitimate under Article 51.
Article 2(4) of the UN Charter prohibits the use of force by member states (in basic terms, it says war is unlawful). There are two exceptions: if the Security Council authorises collective security action (Chapter VII) or if a member state is the victim of an armed attack (Article 51).
Article 51 allows for individual self-defence (a state can defend itself) or collective self-defence (states can come to the aid of other recognised states).
It does not allow a state to invade another state to defend separatists or private citizens there. Putin can try to claim that it does but it does not. In fact in 1999 he objected to NATO intervening in Yugoslavia in defence of the Kosovo region, saying it was not lawful.