going by the rules vs legalized

going by the rules

legalized

How often have the words going by the rules and legalized occurred in a corpus of books? (source: Google Ngram Viewer )