Can a married person be elected as the Pope? What is The Roman Catholic law for electing the Pope in regards to a married person? If a married person is elected, what will happen to his wife after becoming the Pope?
A married person cannot be elected, because the pope is Bishop of Rome and married people cannot be bishops.

Can 1042: The following are simply impeded from receiving orders:

a man who has a wife, unless he is legitimately destined to the permanent diaconate;


Canon law does allow married men to become deacons (as stated there), and also priests with the individual approval of the Holy See, but it does not extend that relaxation of Canon 1042 to bishops.
These restrictions and relaxations are the same as in the Eastern Churches, so as not to rule out eventual reunification.