I am a 16-year-old boy and a friend told me that in Germany you can touch girls on the bottom and not be punished. Is that true?

No, that’s not true.
A new law was passed in November 2016.
Perhaps your friend doesn’t know that yet.

The law now says:
Nobody is allowed to touch another person on the body “in a sexual way” if they do not want to be touched.
“In a sexual way” means:
The touch has something to do with sex.
Or the touch is in an intimate area.
For example, on the bottom, the breasts or between the legs.
This is also called “sexual harassment”.

Everyone is allowed to decide for themselves how they are touched.
And everyone is allowed to decide for themselves where they are touched.
That is called “sexual self-determination”
That is a right for all people.
Anyone who infringes that right can be punished.