I am having difficulty in understand the meaning of Tzadik. Maimonides says "One whose merit surpasses his iniquity is a tzadik". I have trouble in understanding this sentence. Can someone explain the meaning of the word, what Maimonides means by this sentence? Also how does one become a Tzadik?
The statement of Maimonides to which you refer is from his Yad Hachazaka, Repentence [or: Return] chapter 3. There he writes (in my own loose translation):
How to become a tzadik, you ask? Do what God wants, and avoid doing what he doesn't want.
The Alter Rebbe of Lubavitch, Rabbi Shneur Zalman, explains in the beginning of Tanya that if you take the Rambam's words (which are also Rashi and Tosfos' words) at face value, they create several contradictions.
First, they contradict Rabba, who called himself a beinoni despite the fact that he never stopped learning, to the extent that the Angel of Death had trouble killing him. If the requirement to be a tzaddik was merely a majority of merits, then Rabba calling himself a beinoni would be blatantly false, since his sins (if any) were certainly less than his merits (and would therefore make him a tzadik).
Second, they contradict the words of the gemara in Yevamos 20a and in Niddah 12a, namely, that one who commits a single sin, (specifically, even a d'rabanan) is called a Rasha.
Therefore, the Baal HaTanya explains that when we say a tzaddik is someone who has a majority of merits, it is a "shem hamushal" - a "borrowed name" - from the concept of reward and punishment, because a person is judged (in Beis Din shel Maalah) after the majority of his deeds, and is pronounced a "tzaddik" when his merits exceed his failings.
However, a "real tzaddik" is someone who either has no yetzer hara (evil inclination) at all (this is the "tzaddik v'tov lo", or "tzaddik gomur"), or whose yetzer hara is so subjugated to the will of his yetzer tov (good inclination) that it never even "voices its opinion", and is completely dormant (this is the "tzaddik v'ra lo", or "tzaddik she'aino gomur").
According to the Tanya, only certain souls have the ability to become a tzaddik, so not every soul can. However, someone who works on themselves and rises to the level of a "beinoni" can be granted a "tzaddik soul" by heaven.
This is part of a very long hemshech in Tanya which deserves more attention than I've been able to give it here. At the very least, the first chapter should be read, to see this in context. Excellent translation and explanation below.
Source: First two or three chapters of Tanya.