execute store result score random time run random value 1..2
execute if score random time matches 1 run item replace entity @s armor.head with chainmail_helmet[unbreakable={}]
execute if score random time matches 2 run item replace entity @s armor.head with iron_helmet[unbreakable={}]

execute store result score random time run random value 1..2
execute if score random time matches 1 run item replace entity @s armor.chest with chainmail_chestplate
execute if score random time matches 2 run item replace entity @s armor.chest with iron_chestplate

execute store result score random time run random value 1..2
execute if score random time matches 1 run item replace entity @s armor.legs with chainmail_leggings
execute if score random time matches 2 run item replace entity @s armor.legs with iron_leggings

execute store result score random time run random value 1..2
execute if score random time matches 1 run item replace entity @s armor.feet with chainmail_boots
execute if score random time matches 2 run item replace entity @s armor.feet with iron_boots