See the examples:
1. Tom kissed Peter. He felt happy.
2. Tom punched Peter. He felt pain.
What do you think "he" refers to in 1 and 2 above?
Is there any rules in English to restrict the interpreation of "he" in this cases, or they are just ambuigious sentences?
he better refers to the second person, the object, peter.
The problem with your sentences is that the two things the pronoun could refer to are so close together, it's difficult to know what the speaker actually intended.
Take this sentence:
"If your baby will not drink fresh milk, you should boil it."
Clearly, the writer intended that you should boil the milk, but the word "baby" is sufficiently close to the pronoun that it could be intepreted that way as well. But reorganise the sentence like this:
"The milk should be boiled if your baby will not drink it fresh."
The previous clause only has one noun in it; there is no other noun "it" could refer to. Even though "baby" is actually closer to the pronoun, it is in the same clause; a simple object pronoun cannot refer to the subject of the same clause (it would have to be a reflexive pronoun, as in: "I saw myself in the mirror").