Actually, you are correct, Mormons believe that God the Father, Jesus Christ, and the Holy Ghost are three separate gods, but that they are so united in purpose as to act as 1.
How they get around the 10 commandments…Mormons believe that the God of the Old Testament is actually Jesus Christ. They believe that it is Jesus Christ who the Bible was written about, not God the Father.
How they get around the specific statement…first you must look at what it says in the King James Version. they accept no version but this. “Thou shalt have no other gods before me.” Exodus 20:3. This translation doesn’t say anything literally about not being other gods, just that no gods can come before our God (which they believe is Jesus Christ). Interesting aside to that, they ONLY pray to God the Father. they believe it is sacreligious to pray to ANYONE but God the Father, even Jesus Christ.