"Any code he will write during his employment, Google will be the owner of it."
This might be true for code written during office hours using office resources, but definitely not for code written in free time. I don't think that would be according to German laws.