Small nitpick, if you are* in Germany but have an e.g. Spanish name (e.h. Hector Garcia Gonzalez) then... that's 2 surnames without a dash. I have no idea what happens if you marry or have children, but your example is just the -most basic- version.
*"you are" meaning you'd be a German citizen with a German passport.
> I have no idea what happens if you marry or have children
When you marry, you get to define what is going to be the family name and then children born from that marriage get to be registered with that family name.
In the case of foreign-born people, they can keep the naming rules from their original country. In the case of the marriage between foreigners from two different countries, you have to choose which rules are you going to follow, but the family name stays fixed.
To us (Brazilian marrying a Greek) it was a very interesting process. I have two last family names, and Greek names are gender-conjugated (i.e, the last name changes whether you are a boy or a girl). It the end the simplest thing to do was to just keep only one my last family names.
*"you are" meaning you'd be a German citizen with a German passport.