It's never that simple.
The West and Israel deliberately target a group of people knowing it will kill civilians, but they have a scale of how many civilians are expendable depending on the value of the militant killed.
The US takes it even one step further and targets anyone they claim is proving financial support to terrorists. By this crazy logic, Wall Street is a legitimate target for the other side because it finances the US military.
Bottom line, the definitions and laws are written by those who have the military muscle to enforce their definitions.