Bamidbar3:40

וַיֹּאמֶר יְהוָה אֶל־מֹשֶׁה פְּקֹד כָּל־בְּכֹר זָכָר לִבְנֵי יִשְׂרָאֵל מִבֶּן־חֹדֶשׁ וָמָעְלָה וְשָׂא אֵת מִסְפַּר שְׁמֹתָם׃

And the Eternal said to Moshe: "Count every firstborn male of the children of Israel from a month old and up, and take the number of their names.

Bamidbar 3:40

וַיֹּאמֶר יְהוָה אֶל־מֹשֶׁה

Bamidbar / Numbers 3:40 · Pshat

Bamidbar 3:40

וַיֹּאמֶר יְהוָה אֶל־מֹשֶׁה פְּקֹד כָּל־בְּכֹר זָכָר לִבְנֵי יִשְׂרָאֵל מִבֶּן־חֹדֶשׁ וָמָעְלָה וְשָׂא אֵת מִסְפַּר שְׁמֹתָם׃

And the Eternal said to Moshe: "Count every firstborn male of the children of Israel from a month old and up, and take the number of their names.

Pshat פְּשָׁט

From a month old and up

Parents spend the first weeks of a baby's life anxious: will all be well? Only later do they breathe a sigh of relief. Why does the Torah begin counting the firstborn not from birth?

Rashi: the firstborn are counted from a month, because by then there is no doubt that the child will survive. Netziv: "the number of their names" is said as in the count of all Israel, when a plague was feared and names were counted by slips. But there "head by head" was also said: each man handed in his own slip, while here there was no such fear.

How Rashi and Haamek Davar explain it

Rashi Count every firstborn male from a month old and up

Once he is out of the doubt that he may not survive.

Haamek Davar The number of their names

As in the count of Israel, when a plague was feared. That is why the command was that they hand in slips and the names be counted. But in the count of Israel it is written "head by head": each one handed in his own slip, so that there would be no forgery. But here there was no such fear, as explained shortly.

Takeaway

A baby who may not survive (נֵפֶל) is how a child in the first thirty days is described. After thirty days his life is no longer in doubt (Shabbat 135b).
The fear of a plague at a count comes from the Torah: "that there be no plague among them when you count them" (Shemot / Exodus 30:12).
"Head by head" (לְגֻלְגְּלֹתָם) is said of the count of all Israel (Bamidbar / Numbers 1:2). In the count of the firstborn this word is absent.