The sentence that is not grammatically correct is A.
Eres el quintos hijo en la familia. Because there is not agreement between the adjective (quintos) which is in plural and the noun modified (hijo) which is in singular).
The only sentence that is grammatically correct is: B. Juan es el segundo nieto.
In Option A: the word segundo is incomplete
In option C: there is not agreement in genders segunda is female and nieto is male.
In option D: there is not agreement in number (segundos is in plural and nieto is in singular)