Capital Gains Tax

My wife has two residential houses in her single name and in the third she is 50 % owner. We wish to purchase amother new house within the next month, which we wish to do jointly. Meaning now she will fully own 2 houses and be 50 % owner in 2.
My query is if she sells one of the houses in her single name (held in her name for more than 3 years) can she urilize the capital gain to purchase another residential house? Can this house be put jointly in my wife's and my name?