All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
We value highly the concern of the questioner about his religion and seeking what is Halal.
Know that marriage in Islam requires the consent and presence of the guardian of the woman, the presence of two witnesses, dowry, and approval of the two parties. The Prophet said: “Marriage is not valid except with (the consent and presence of) the guardian” [Ahmad]
The guardian is the father of the bride, or her son, or her brother, or a person who can act on their behalf. A guardian should be pubescent, sane and a Muslim; possessing the quality of honesty is not a condition.
‘Aa’ishah said that the Prophet said: “Four people should be present in the marriage: the guardian, a husband and two witnesses.” [al-Daaraqutni]
If a person was in an environment where the above mentioned factors were not available and he lacked knowledge and married in a way that he thought was a legal way; then in this case, we hope that he is not considered a sinner and it was not Zina (fornication or adultery) either, since he was ignorant and did what he could.
Allah Says (what means): {Allah does not charge a soul except [with that within] its capacity.} [Quran 2: 286]
However, after knowing the legal way of marriage he should renew his marriage fulfilling all the conditions mentioned above.
Allah knows best.