Four female Israeli soldiers will be released by Hamas in the second exchange under a ceasefire deal that has halted the Gaza war.