It's impossible to separate civilian and military targets in Gaza by design. That building also contained Hamas offices. Hamas intermixes with the civilian population to generate the maximum number of civilian casualties when Israel attacks.
Israel did one thing to try to prevent injuries to civilians: They spread warnings about a ground invasion to get all the Hamas soldiers into their underground tunnels. Then they bombed the tunnels with ground-penetrating weapons to blow them up. They knew Hamas would not let civilians into their tunnels.
Never forgot Benjamin Netanyahu having the gall to come to our country and undermining a sitting president by giving a Republican-sponsored vanity speech to a Joint Session.