In the first place, then, we must show the way to find out whether a phrase is literal or figurative. And the way is certainly as follows: Whatever there is in the word of God that cannot, when taken literally, be referred either to purity of life or soundness of doctrine, you may set down as figurative. [III.x.14]
This tells us more than just that single principle, actually. He also hereby tells us something of his understanding of what exactly the purpose of the Bible is: that is, it is to instruct us concerning how to live and what to believe. This being the case, then, any passage that doesn’t literally have something to do with either of those goals must be interpreted figuratively. The human author may not have intended this, but God must have.