Every child has right to freedom and protection from war according to UN Convention on the Rights of the Child.
“Governments must not allow children under the age of 15 to take part in war or join the armed forces. Governments must do everything they can to protect and care for children affected by war and armed conflicts.”
Summary of UNCRC Article 38 (war and armed conflicts) on UNICEF website