Disclaimer: I'm no expert to say the least
"Pursuant to Article 8(2)(a)(viii) and (c)(iii) of the 1998 ICC Statute, the “[t]aking of hostages” constitutes a war crime in both international and non-international armed conflicts"
Whatever the purpose, taking hostages is a war crime. Even if the enemy commits war crimes (some blame Israel for those: here, I won't say it does or it doesn't, cuz I am not educated enough on the topic), war crimes cannot be committed against it (or civilians on the enemy's side). You can't just say "they are war criminals for a good reason" cuz Geneva Convention and ICC Statute exist for a reason. You can say "Palestine good war crimes bad" if you want, that won't contradict anything. But don't excuse war crimes pls😭
>>one Israeli soldier captive
Exactly. Soldiers. Those are prisoners of war, not hostages. So HAMAS can exchange POWs for Palestinians detained in Israel. That wouldn't be a war crime.