Salvation has always been by grace, through faith in God. God gives even New Testament Christians commandments, but we still sin. King David committed capital sin, for which no animal sacrifice could be offered, but the blood of Jesus atoned for this. Either King David went to hell, or salvation was always by grace alone, through faith alone, in Christ alone.
David was circumcised, kept the Law imperfectly, offered animal sacrifices throughout his life.
If he missed out any of those, would he still have been saved?