The distinction is not between civilian targets and military targets, it is between “civilian objects” and “military objectives”. Targeting a civilian infrastructure such as refineries, and even civilian power stations can be considered valid military objectives if they make an effective contribution to military action or offer a definite military advantage. The refineries being hit by Ukraine definitely meet that definition.