Paul in Romans 3:27 says:
Then what becomes of our boasting? It is excluded. By what kind of law? By a law of works? No, but by the law of faith.
Unfortunately, Paul never explicitly tells us what this law is that he is referring to (this is the only occurrence of the phrase not only in Romans, but in the entire Bible.) In order to understand his meaning, we’re going to have to do a bit of exegetical work on the argument he is waging in Romans 3 and preceding.
Paul’s Argument in Romans 3
Paul in Romans 3 is trying to teach his Roman church audience his understanding of God’s righteousness, and that righteousness as justifying His rationale for inaugurating His New Covenant through the gift of His Son, that is inclusive not just of Israel (as was the Mosaic Covenant) but of “all nations” (i.e. Gentiles) as well.
To have a chance of understanding the extremely nuanced explanation that Paul presents in this chapter, we have to have firmly in mind Paul’s own context. Paul, elsewhere, tells us he was a Hebrew among Hebrews, circumcised on the eighth day, a Pharisee, a zealous persecutor of the Church and “as to the law, blameless” (Philippians 3:5-6), who had met Christ in a specific revelation and learned, deep down, the ways in which he had misunderstood God/his Lord, and the purpose of His law. He now knows God’s new covenant (Jeremiah 31:31-34, Ezekiel 36: 26-27) has been inaugurated through Christ’s life, death, and resurrection. And, he knows above all that in this God is vindicating His righteousness. He had promised 70-year-old Abraham that he would be the father of multitudes (Gen 15:5) and that his seed would be a blessing to all the nations (Genesis 22:18). So Paul knows that the time has come for this new Way. And he wants, more than anything, to convince his Jewish brethren in the Roman Church of this understanding.
In Romans 3:9-20 we find Paul teaching that no one is righteous before God – Jew or Gentile. This is obviously a case made for his Jewish brethren as the Gentile members of the Church in Rome would have never had an expectation of the status of “righteous” before God. It was the Jew who thought and was taught that his people were the chosen of God and that if he was merely obedient in pursuing his adherence to the Mosaic covenant under which his people were formed, he would preserve his position in this covenant people and, therefore, his favor before God.
At this point, Paul brings the hammer down on this understanding, declaring that it is by faith that one is justified before God, not “works of the law” (or anything else). And this is where we have to get down into the details of what was in Paul’s mind in writing these admonitions.
And here we run into a long-running debate: by “faith” (πίστις), is Paul speaking about our faith that we have in his gospel? Or is he talking about God/Christ’s faithfulness in fulfilling the Abrahamic Covenant and other scriptural prophecies (the same Greek word is variously translated ‘faith’ or ‘faithfulness’ or even ‘belief’ depending on the context of its usage)?
The most persuasive, detail-focused argument I have seen[i] makes the case that Paul’s primary idea when in Romans he uses the term ‘πίστις’ is the faithfulness of God/Christ. Let’s look at his initial invocation of his ‘hammer’ re: faith, and see if this makes sense.
In Romans 3:21-22 we read:
 But now the righteousness of God has been manifested apart from the law, although the Law and the Prophets bear witness to it—  the righteousness of God through faith in Jesus Christ for all who believe. For there is no distinction:
In this translation (ESV) the translators support the idea of our faith: “the righteousness of God through faith in Jesus Christ for all who believe.” But that’s not the only possible translation (see various Bible’s translations).
The King James, for example, says:
Even the righteousness of God which is by faith of Jesus Christ unto all and upon all them that believe
The faith of Jesus Christ. The International Standard Version improves this:
God’s righteousness through the faithfulness of Jesus the Messiah — for all who believe.
The technical issue has to do with how to translate the term πίστεως Ἰησοῦ (faith of/in/on/from Jesus). The ESV (and many, many other translations) use the so-called “objective genitive” translation, while the KJV, ISV and others use the so-called “subjective genitive” noun phrase.
To help us see the distinction, try this thought experiment. Should we really believe that “the righteousness of God” is through our faith in Jesus? Is God’s righteousness in any way dependent on our faith? Didn’t God demonstrate His righteousness by Him demonstrating His faithfulness in the obedient human incarnation, life, death, and resurrection (faithfulness) of Jesus?
So what is Paul really telling the Roman Church, and us, in these verses (and in Romans, in general)?
The overarching theme Paul is expounding at this point is how one, Jew or Gentile, becomes justified before God. Here’s where it gets really fascinating. Paul is saying that God has sent His Son (“the righteousness of God has been manifested”), which “the Law and the Prophets bear witness to”. He goes on to say that “the righteousness of God through faith in/of/on/from Jesus Christ for all who believe.”
To Paul, what is our role? “for all who believe.” Believing the Gospel is our role. What is Christ’s role? Being the manifestation of God’s righteousness – “the righteousness of God through (the) faith(fullness) of Christ”. How did Christ demonstrate His faithfulness? In His life, death, and resurrection.
Are we to have faith/believe in Christ? Most assuredly! Paul switches his references between our faith and Christ’s faithfulness with abandon, so you have to read him attentively and deeply. This is one of the reasons people struggle with Romans. But here, he is speaking of Christ’s faithfulness, in my opinion.
The Law of Faith
So, when we finally arrive at Paul’s use of the phrase “the law of faith”, what is he thinking?
The first thing we need to notice is that justification before God, the object of Paul’s discourse, is attributed to God’s grace in verse 24:
and are justified by his grace as a gift, through the redemption that is in Christ Jesus,
So he tells us outright that our justification before God is God’s gift through His faithful provision of Christ Jesus. He goes on to say that Christ was the demonstration of His righteousness so that He, in redeeming both Jew and Gentile who believe, would be vindicated and shown to be faithful to His promise to Abraham.
Paul perhaps earlier tipped his hand concerning this “law of faith” in 1 Cor 9:21 when he refers to the “law of Christ:
To those outside the law I became as one outside the law (not being outside the law of God but under the law of Christ) that I might win those outside the law.
To Paul, seemingly, the “law of Christ” is that Christ is Lord; Christ is Messiah and God, and those who believe His gospel, be they Jew or Gentile, are those who have inherited the Abrahamic promise.
Additionally, Paul returns to this argument in Romans 10 and says in Romans 10:4:
 For Christ is the end of the law for righteousness to everyone who believes.
So what, exactly, is in his mind as he pens the phrase “the law of faith”? In answering, we need to keep in mind Paul’s background in Phariseeism. As a pharisaic rabbi, Paul knew all of the prophecies of scripture predicting the figure of the Christ – the Messiah. He knew Zechariah backward and forwards and would have Zechariah 8 in his memory, including God’s promise to return to Israel and Jerusalem (Zechariah 8:3). As well, he had memorized Jeremiah, particularly his New Covenant promises (Jeremiah 31:31-34) and Ezekiel’s (Ezekiel 37:26). For Paul, this was all about God’s faithfulness to His promises.
I believe he holds these two ideas simultaneously in his mind: the faithfulness of YHWH in keeping His promises and His Christ in honoring His commitment to become incarnate, be reviled, disrespected by men, mutilated and crucified, and then resurrected on behalf of all who would believe Him, and the requirement that for this redemption to be effective for us, our faith in this story and calling is also required. In other words, this law (like so many of God’s covenants) is conditional. If you don’t believe the gospel Paul is preaching, you are not a beneficiary of the faithfulness of God through Christ. If you do, you are. And that is the “law of faith”. And it is a distinct echo of what Paul asserted early in this epistle, Romans 1:16:
For I am not ashamed of the gospel, for it is the power of God for salvation to everyone who believes, to the Jew first and also to the Greek.
Paul’s “law of faith” seems to be his two-fold Gospel: “Christ’s faithfulness demonstrates the righteousness of God; believe it”.
Sometimes we can feel like one who only understands Newtonian mechanics trying to understand quantum mechanics when reading Paul. He was brilliant, but sometimes quite obscure – perhaps intentionally, or perhaps because we have experienced a degree of spiritual rigor mortis from our years of hearing the same, stale teachings. Our only solution is more study and thoughtful exegesis of his words, not simply acceptance of what others tell us he’s saying, in the tradition of the Bereans (Acts 17:11).
[i] A Prepositional Phrase’s Contribution to the πίστις Χριστοῦ Debate in Romans 3:28” (You’ll need a free academia.com account to access this paper/book)