Good question. The short answer is that we become members by being taught fundamental doctrines and principles and then by being baptized. However, as part of that, we commit to keeping God’s commandments and taking upon ourselves Christ’s name – meaning we try to live our lives and treat others as Christ would. Missionaries teach people these fundamental doctrines and commandments, and then ask them to pray and ask God if what they’ve taught is true. Here are some links to other articles that may be useful too.
How do I become a member of the Church of Jesus Christ of Latter-day Saints?
Fundamentals of the Gospel
How Do You Pray?
Missionaries Knock On Your Door: What to Expect
Repentance Before Baptism
What Do Mormons Believe? – Baptism
What does baptism entail?