The 4th Geneva Convention (relative to the Protection of Civilian Persons in Time of War) states in Part II, Article 14: "Civilian hospitals organized to give care to the wounded and sick, the infirm and maternity cases, may in no circumstances be the object of attack but shall at all times be respected and protected by the Parties to the conflict.".
Seems straightforward enough. Civilian hospitals are off limits as military targets.
However, this is qualified in Article 19: "The protection to which civilian hospitals are entitled shall not cease unless they are used to commit, outside their humanitarian duties, acts harmful to the enemy. Protection may, however, cease only after due warning has been given, naming, in all appropriate cases, a reasonable time limit and after such warning has remained unheeded.".
So if the enemy was using a hospital as a military base, was using a hospital to store weapons and to provide refuge for fighters, then it loses its protection as a hospital and becomes a fair target (once warning has been given).
Now what is going on in Gaza today?
From the Jerusalem Post:
The defense officials said it was likely that a number of senior Hamas operatives and terror chiefs were hiding and conducting their operations from within Shifa Hospital in Gaza City.
"Hamas operatives are in the hospital and have disguised themselves as nurses and doctors," one official said.
This echoes the claims made by Shin Bet head Yuval Diskin a few days ago (and let's not even get into the use of hospitals as excution grounds". And they don't exactly have an exemplary history of maintaining the neutral status of ambulances. It seems like Hamas is trying to take advantage of Article 14. Too bad they didn't read all the way to Article 19.
Now, I realize that Hamas is not actually a signatory to the Geneva Convention. However, as of July 1951, Israel is. And even if Hamas and the PLO have not obligated themselves to act according to any of these treaties (for once they refrained from signing something that they knew they would not be able to fulfill) Palestinian media talking-heads and anti-Israel commentators around the world have no hesitation in accusing Israel of war crimes. If Israel were to attack a hospital (which they might end up doing if Hamas starts using hospitals as launching grounds for missile attacks), as sad and unfortunate as it would be (since many civilians would be injured or killed), it would be an attack on a legitimate military target, and the fault would lie exclusively with those who decided to remove the protective status accorded to the hospital through the Geneva Convention by making it into a war base.
They have been warned.