The only “legitimate targets” in Ukraine are those occupied by or being used for the Russians. This is a war of aggression. Hence, the invasion itself is unlawful, and Ukraine’s military is no more open to lawful attack than its civilian population, whether or not they are engaged in arms-making.
Obviously the Russians have zero regard for law and target civilians indiscriminately whether or not they’re combatants,
Also that.
but if Ukraine wants to make a case for war crimes in international eyes, does this undermine that?
I don’t see why it should. See my first point. See also the Nuremberg trials (among others), where many of the defendants were charged with waging a war of aggression: that charge by itself is sufficient to warrant a trial for war crimes, even if all the other laws of armed conflict are scrupulously adhered to (and as you acknowledge, they surely have not been).
Bottom line, Russia has no right to use force against anyone or anything in Ukraine, whether or not it is a military target. Russian soldiers in Ukraine likewise have no right of self-defense, and their lives as such are forfeit unless and until they either surrender to Ukrainian forces or otherwise signal their intent to immediately withdraw from hostilities.