"У них было два ребёнка."
Translation:They had two children.
Your answer is correct too:
У них было двое детей
Next time you may click a button "Report a problem - My answer should be accepted"
(The following is a paraphrased entry  from gramota.ru)
When the subject has a numeral, the predicate (the verb) may be used either in singular or in plural form. Sometimes only singular form is acceptable, sometimes only plural, sometimes both are correct. Factors that influence this rule are the following:
Singular form is preferred if: the subject is passive; the verb means unity of action; the numeral is the important part of the sentence. In particular, "being" verbs (есть/было, существует, имеется) stress passiveness of the subject.
Plural form is preferred in opposite cases: the subject is active; the verb means that the action is done separately by each individual; the verb, not the number is the important part of the sentence.
Numerals ending with один usually require singular form.
Don't know much about this verb so far but why is it было? было is neuter while ребёнок is masculine?
In this situation (subject has a numeral and the predicate becomes a singular form), the predicate is always used in neuter gender. I'm afraid I don't have a good explanation why. I guess it wouldn't make sense to agree in gender but disagree in number.