First, I suggest that you don't believe Hamas about the numbers of casualties and certainly not about whether they were all civilians.
Second, Palestinian terrorists took these Israeli hostages from Israel into Gaza and into a civilian neighborhood in Rafah. Israel didn't choose where this, or any other battle will be. That was the choice of the terrorists.