Bechorot 19 - What Is Considered A Firstborn?
In the previously discussed case of simultaneous births , the final law follows the view of the Sages that things cannot be so precise. Therefore, one of the two born males is the real firstborn, but we don't know which one. Rabbi Tarfon says that the strongest and best is usually born first, and therefore the kohen gets the better one. However, later Rabbi Tarfon changed his mind. Rabbi Akiva says that the kohen would have to prove his claim in court, and since he can't, he gets the worse one.
The remaining lamb still might be a firstborn, and for this reason it is let to graze until it develops a blemish, and then it may be slaughtered and consumed. From this second one, the kohen gets the gifts, because he can advance the following two-prong argument: if it is a firstborn, it should completely belong to me, and if it is not, at least the gifts should belong to me!
To have the law of the firstborn, the animal needs to be a male, be the first offspring of its mother, and be vaginally delivered, because the Torah required it to be the "first one to open the womb."
Art: Sir Hubert von Herkomer - The First Born