Under the Hindu Marriage Act, 1956, a marriage is valid only if neither of the people getting married have living spouses at the time of the marriage. That means, for your marriage to X to be valid, either Y should have passed away, or divorced from you.
Further, section 17 of this Act makes Bigamy (either party getting married has a husband or wife living) a punishable offence under Sections 494 and 495 of the Indian Penal Code (punishment of 7-10 years imprisonment and fine).
Thus, you can get married to X only after you have divorced Y, and will not be able to be married to both women at the same time.
We disagree with this advocate. Such a permission of court is impossible to obtain. Marrying two women at the same time is illegal, in fact it is a criminal offence for which you could be jailed. Hence a court will never give such an order, even if the situation is a genuine one, and all parties are okay with it.One practical solution would be that you could make X live with you in your house with Y, but without marrying her.Issue is, even if you marry X, your marriage with her will beA. Invalid. Hence x will never be your wife legally.AND it will beB. A criminal offence. If somebody gets to know that you are married to both at the same time, they might report you and you will not only lose your job, but also be imprisoned and fined. Thus we strongly advise you not to marry X while being married to Y. The only way you can do this, is to divorce Y. However, since that option is not available, the nearest practical and legally valid solution is to have a live in relationship with X, but not marry her.