To be "outside the law" is a metaphor that means not to be obligated to obey the law. "The "law" refers to the law of Moses, and "those outside the law" refers to the Gentiles. Alternate translation: "To Gentiles, who are not obligated to follow the law of Moses, I became like them" (See: [[rc://en/ta/man/translate/figs-metaphor]] and [[rc://en/ta/man/translate/figs-explicit]])
The phrases "not outside the law" and "under the law" are metaphors that mean to be obligated to obey the law. Alternate translation: "although I was not one of those who is not obligated to obey the law of God, but I was obligated to obey the law of Christ" (See: [[rc://en/ta/man/translate/figs-metaphor]])