Before the grace dispensation, i.e during the OT, Jews were saved by faith in what God revealed to them.
And what did God reveal to them during that time? "Keep the Law of Moses, circumcise your male kids, and offer an animal sacrifice every time you sin."
As long as they do that, God considers that as "putting their faith in him" and he will see them as righteous before him, as what the prophet Balaam found out in Numbers 23:18-21.
As for Gentiles, before Paul, they have to be saved as a Jew. Gentiles could only be saved as a Jew, meaning they have to be willing to be circumcised and under the Law of Moses (Exodus 12:48). There was no other way a Gentile can be saved.