Yevamos 10:8-9
Yevamos 10:8
If a minor of nine years and a day performed yibum with one widow and then he performs yibum with her co-wife, he disqualifies both of them to himself; Rabbi Shimon says he does not disqualify the first widow to himself. If the minor of nine and a day performed yibum then died, the widow performs chalitzah with one of the other brothers but not yibum. If the minor married a woman and then died, his widow is exempt from yibum or chalitzah.
Yevamos 10:9
Let’s say that a minor of nine years and a day performed yibum, then after he reached the age of majority he married another woman, after which he died. If he did not have sexual relations with the first woman after he reached adulthood, then she performs chalitzah but not yibum, while the second woman may perform either chalitzah or yibum. Rabbi Shimon says that a surviving brother may perform yibum with either wife and chalitzah with the other. All of these laws apply equally to a minor of nine years and a day and to a 20-year-old who has not grown two pubic hairs.