Israel and Hamas will exchange hostages and prisoners as part of the deal to end the two-year war.