A child gets a name from each parent, always the first of the parents' two surnames, so the children of a couple will have a different double surname to their parents.
For example...
Juan Pomarés Diaz marries Ana Rios Garrido. As per Hispanic naming custom, the parents retain their own surnames. They have a son and name him José. José's surname will be Pomarés Rios OR Rios Pomarés, the first of each of his parent's surnames. Usually the paternal name goes first, so José would most likely be José Pomarés Rios, and for the purposes of this that's what he'll be.
As far as subsequent children go, I know people here in the UK who think that Hispanics can 'flip' the order of the surnames for each gender, say paternal name first for boys and maternal names first for girls. This is incorrect. The surname order must be the same for each child. This is law.
So when Juan and Ana have their second child, a girl named Ester, she will be Ester Pomarés Rios.
When addressing an Hispanic, you should use both surnames, or just the first surname. It is incorrect to only use the second surname. For example, José should be addressed as Señor Pomarés Rios OR Señor Pomarés, but never as Señor Rios.
NB: Some Hispanics, myself included, who also have a double first name. So José might be called José Santiago Pomarés Garrido. Santiago is part of his first name, not a middle name, as middle names don't exist in Hispanic culture.