Caging a dog is believe it or not, one of the best things u can do for it. An inside cage, that is. Not outdoors. Like for my dog tess, she has her little room, its a cute golden cage, large enough for her to move around in, but its not huge and obtrusive to the house. She has a waterbottle and food dish in there. They will yelp for a few days if you leave them in there, but soon they will grow to realize it is THEIR ROOM, not THEIR CAGE. Whenever tess is bored, she just goes and lays in there. it is near my comp, so when Im sitting here online, she will lay there and watch me. I have a matt in there for her, so she loves it. Plus, caging them guarantees they wont ever get bored and chew your stuff.
Anyways, sorry I got off-topic. Ive found the most affective way to train it to go outdoors is just to watch it closely. If you see it getting ready to pee or poop, say "NO NO NO" kinda loud but not mean. Pick them up by their tummy and do your best to carry them out the back door. This will teach them that when they need to go, they need to be outside. Also say "Go potty" or whatever you wanna call it while they are going. They will get used to this command. Then you can just walk to the door after a while, open it and say "go potty" and they will do it

Not so hard, just takes time
Oh yeah! like these guys said, rewards are a BIG part of learning for dogs. Everytime they go outside, pet them and say good boy/girl! And give them like a half a treat or something - depending on the size of the dog.