In Romans 1-3 Paul wants to show all are hopeless if they try for justification by law, can't keep it. But in 2:14-16 he says some gentiles do make it by keeping law. How?

This is a factual picture, not the focused picture of Romans1-3 in general. Some say Paul speaks in Rom 1 only of tendencies- but then Paul's thrust would be void, for he is trying to prove that no one can gain justification by keeping the law.