Rom. 1 shows that all men are universally condemned and without excuse, even if they have not heard of Jesus. God also judges according to light we have and will do the right thing (Gen. 18:25). Babies lack moral/mental capacity and go to heaven based on their non-rejection of Christ. The Bible is clear about people like you and me who have heard the gospel. We can make inferences about those who have not heard (post-mortem salvation, universalism, inclusivism, annihilation, etc. are all heretical views).
As to the Old Testament, people were saved based on trusting YHWH and His provision/plan at the time. They had the shadows/types and we have reality in Christ (Heb. 1:1-3). They looked forward to the cross by faith and we look back on the finished work by faith. Calling on the name of Jesus (Rom. 10:9-10; Phil. 2:5-11) is calling on the name of YHWH. The OT saints called on God as Savior and NT saints call on God in Christ as Savior (Jn. 14:6; Acts 4:12; Jn. 3:16). In all this, all believers in all generations are saved by grace through faith apart from works in God's revelation/provision at their time. We are in the Church Age, so leave the judging to God and embrace our gospel, the power of God (Rom. 1:16).