473. International humanitarian law prescribes that parties to the conflict should take all feasible precautions to protect the civilian population and civilian objects under their control from the effects of attacks and to the maximum extent feasible avoid locating military objectives within or near densely populated areas.[1] The commission notes that this obligation is not absolute and that even if there are areas that are not residential, Gaza’s small size and its population density makes it particularly difficult for armed groups always to comply with these requirements. The ICRC Commentary on Additional Protocol I notes that several delegations of the Diplomatic Conference commented that for densely populated countries, the requirement to avoid locating military objectives within densely populated areas would be difficult to apply.[2]But when the ICRC said that, they were referring to normal countries who cared about their civilian population!
This sub-paragraph covers both permanent and mobile objectives. As regards permanent objectives, governments should endeavour to find places away from densely populated areas to site them. These concerns should already be taken into consideration in peacetime. For example, a barracks or a store of military equipment or ammunition should not be built in the middle of a town.When the government is manifestly not concerned with the safety of its population, these caveats do not apply.
As regards mobile objectives, care should be taken in particular during the conflict to avoid placing troops, equipment or transports in densely populated areas.
In both cases it is likely that governments are sufficiently concerned with sparing their own population and that they will therefore act in the best interests of that population.
[...]
Several delegates at the Diplomatic Conference stressed the fact that for densely populated countries this provision was difficult to apply.
And the UNHRC report goes on to note that this is indeed the case::
[I]n a number of instances, Palestinian armed groups appear to have conducted military operations within or in close proximity to sites benefiting from special protection under international humanitarian law, such as hospitals, shelters and places dedicated to religion and education. The United Nations Board of Inquiry into specific incidents that occurred in the Gaza Strip between 8 July and 26 August 2014 found that in some cases Palestinian armed groups conducted military operations in the vicinity of UNRWA schools. In one case, it noted military activity by both Palestinian armed groups and the IDF in the vicinity of Beit Hanoun Elementary Co-educational “A” and “B” school, which was being used as an UNRWA designated emergency shelter. In the case of the Jabaliya Elementary “C” and Ayyobiya Boys School, an area adjacent to the school was reportedly used by Palestinian armed groups to fire projectiles. In the case of the Nuseirat Preparatory School Co-educational “B” School, the “presence of weapons and other evidence” indicates that Palestinian armed groups may have fired 120 mm mortars from the premises of the school. In another case, media reports quoted the Greek Orthodox Archbishop in Gaza as stating that the church compound, in which approximately 2,000 civilians took refuge, was used by Palestinian armed groups to fire rockets.
In the end the UNHRC concludes in a wishy-washy manner:
Given the number of cases in which Palestinian armed groups are alleged to have carried out military operations within or in the immediate vicinity of civilian objects and specifically protected objects, it does not appear that this behaviour was simply a consequence of the normal course of military operations. Therefore the obligation to avoid to the maximum extent possible locating military objectives within densely populated areas was not always complied with.The UNHRC's quote of what a minority of delegates to the ICRC conference thought is utterly irrelevant to the situation of an armed group that deliberately and provably chose to embed its arsenal among the civilian population. Its conclusion is close to correct, but its decision to quote a contrary opinion that doesn't apply to Gaza and Hamas is an indication of how much the commission tried to justify Hamas actions that endangered civilians.