In Exodus 22:29 it says
Do not hold back offerings from your granaries or your vats.g]
“You must give me the firstborn of your sons. 30 Do the same with your cattle and your sheep. Let them stay with their mothers for seven days, but give them to me on the eighth day.
In the websitehttp://thetorah.com/giving-your-firstborn-son-to-god/ they state that it is clear in a later passage that the human son is to be redeemed:
|“34:19 Every first issue of the womb is Mine, from all your livestock that drop a male as firstling, whether cattle or sheep. 34:20 But the firstling of an ass you shall redeem with a sheep; if you do not redeem it, you must break its neck. And you must redeem every firstborn among your sons. None shall appear before Me empty-handed.|
This passage as well presents an analogy between the treatment of firstborn animals and humans: all belong to God. But here the firstborn of an ass—an animal that may not be sacrificed—must be redeemed, or exchanged, for a sheep, and the firstborn of a human mother must likewise be redeemed. This law upholds the principle that all firstborns belong to God, while making a practical distinction between firstborns that are slaughtered on an altar (“kosher” animals) and those that are not (“non-kosher” animals and humans).”
This website also has a lot of information on this topic:https://bible.org/question/what-significance-%E2%80%9Cfirstborn%E2%80%9D-bible