Article by Michael Goforth II:
In an online setting like this, it would be easy to give a quick theological response to such a question without considering the gravity of such a situation. I recently attended the funeral of a stillborn infant. I cannot even begin to express to you the pain I felt in my own heart as I watched that Christian mother hold her lifeless newborn in her arms and weep during the service. With that in mind, let us consider the importance of relying on God as we attempt to answer a question like this.
Before getting to my response, I think it is important to affirm that the Scriptures are quite clear about the fact that all people are born as sinners already under divine condemnation. (Ps. 51:5, 58:3; John 3:18; Rom. 5:12-21) If a person does not respond to the gospel of Jesus Christ with repentance and faith before they die, they will spend all eternity separated from God in a place of torment. (Rom. 3 ; John 3 ; Luke 16) Jesus was quite clear when He said, “Ye must be born again.” (John 3:7) With these truths in mind, there is no Scriptural basis for an “age of innocence.” If God were to allow an infant or someone who is incapable of understanding the gospel into Heaven, it would not be because they were innocent.
That being said, we serve a very merciful God. After David’s sin with Bathsheba, his child of only seven days of age died. When his servants informed him, he responded, “But now he is dead, wherefore should I fast? can I bring him back again? I shall go to him, but he shall not return to me.” (2 Sam 12:23) It is clear here that David was persuaded that he would see his child again one day. We also know from other passages that David knew he would spend eternity in Heaven. (Ps. 23:6) Therefore, David was expecting to see his child again in Heaven.
How can this be if the child was under divine condemnation the moment he was conceived? The answer must be that God, in His great mercy, must have applied the merits of Christ’s redemptive work to the child’s account before he died. In a miraculous act of grace, the Holy Spirit regenerated the child so that he could enter the kingdom of heaven. (John 3:3) Is there evidence that God does this to infants? He certainly did with John the Baptist, “he shall be filled with the Holy Ghost, even from his mother’s womb.” (Luke 1:15)
The Holman Illustrated Bible Dictionary offers this helpful comment, “God’s Word does not present an explicit and unequivocal case for infant salvation; it is somewhat silent on the question. Insofar as it does address the relevant issues, however, it seems clearly to imply that those who die before reaching an age of responsibility will not be condemned by God, even though they are sinners by nature and choice, but will instead be received into eternal salvation.” 
In conclusion, let us remember God’s unfailing love, mercy, and grace. Let's trust that the Judge of all the earth will do right. (Gen. 18:25). And let's take comfort from the example of David in 2 Samuel 12. If you know someone going through this pain, walk with them through the grieving process offering prayer and comfort from the Scriptures.
 Brand Chad, “Accountability, Age Of,” ed. Chad Brand et al., Holman Illustrated Bible Dictionary (Nashville, TN: Holman Bible Publishers, 2003), 18.