By following the rules and terms of service.
By being a good gamer and playing nice. There's lotsa rules about playing online, but they're kind of what a human being should be like anyway. It basically boils down to "Be nice, don't insult people, don't give people your home address, and don't try to have sex with strangers over your XBox headsets."
But if banned... There is a way to get unbanned... takes some time but if you want to be on live again it's worth it.