When do we need to break the rules?

Sometimes religions can be very dumb. It is the case of my religion – The Catholic Church. In Brazil, we had this case of a young girl who got pregnant and the priest said – no abortion. Why? Because the canons of the Church – without considering the circumstances – denies abortion. So, I would like to know from you when we need to break the rules. Also, if you could elaborate and give me a list of the times when you broke the rules, I would appreciate.