Practice, Practice, Practice
Housetraining takes time. If your pug is having lots of accidents, review your schedule to see where you might be going wrong. Take him out more often, and don't forget to crate him or put him in his safe room when you can't watch him.
If the amount of time you have to housetrain your pug is limited by work or school, accept that the process will take longer. Be willing to back up to a point where he was being successful, and stay there for a while before you start asking him to wait longer intervals to go out. Patience and a positive attitude will get you successfully over the housetraining hurdle.