Geneva Conventions, bombing hospitals, exception when combatants shelter there

This is a factual question. I’ve heard on news programs that the Geneva Conventions (or the documents they generated) say a military cannot bomb certain targets such as hospitals and schools. But I’ve also heard on these programs that the documents further state that in the case that combatants choose hospitals and schools as locations for their operations, headquarters et cetera, the prohibition against bombing those places become void. The news programs don’t report on this factual point. Can anybody point to the texts themselves and the places where these statements occur?

I’ve read a bit but the topic seems very complex, so I’m hoping somebody here already knows or can provide expedient tips for finding the answer.

There is obviously relevance to current events but I don’t want to discuss those events per se, not here. Just looking to verify or debunk the claims I’ve heard on news programs regarding the specific text.

Thank you!!

Article 19 - Wounded and sick IV. Discontinuance of protection of hospitals
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.

The fact that sick or wounded members of the armed forces are nursed in these hospitals, or the presence of small arms and ammunition taken from such combatants and not yet handed to the proper service, shall not be considered to be acts harmful to the enemy.

https://ihl-databases.icrc.org/en/ihl-treaties/gciv-1949/article-19

This pretty much covers it, but basically, when hospitals are used to launch attacks they lose their protection.

Thank you! You’ve given me exactly the answer I was looking for!

The Dope is amazing.