I'll focus not just on syntax (like the stuff that gives syntax errors during compiling) but also common built-in functions and constructs. (E.g. things like Java map/filter, Python3 print, Rust unwrap()).
In the beginning, either as a new programmer or when learning a new technology or language, you will look up a lot, and that's okay.
After a while (weeks or months), without a need to specifically try for it, you will remember more and more automatically, because you've looked it up repeatedly.
Being able to type at least 80% of lines without Googling does help your productivity, I feel. Not a whole lot - the concepts are harder than the syntax - but it helps.
But going for 100% is not useful, except during bad interviews. The last 5% of your lines is spent on 50% of constructs. Stuff that is rare enough that it'd take long to learn, and you don't lose much time looking it up. There's even syntax that doesn't come up at all, in many languages.
So in some key points because who doesn't like lists:
A<B> for generics, { } around blocks in many languages...).Also note that autocomplete is much faster than Googling in many cases.
*Unless you're working on something like an Oracle Certified Associate certificate, in which case, stop that and go do something useful instead.