I'm afraid you'll have to partake in the most time-honored of traditions: discipline. Puppies respect authority and simple, easy-to-remember rules.
If you're crate-training him — meaning putting him in a crate or cage temporarily as a "time-out" — remember that, after 20 minutes, he won't remember why he's in there.
Get your lil' pooch on a schedule. Feed him at the same time, every day. Take him out multiple times throughout the day, every day.
Make sure the primary ingredient in his dog food is meat (e.g. pork, beef or lamb — NOT filler like corn or wheat).
Make sure his doggy treats are hard and dry — this will keep his teeth healthier.
If he goes to the bathroom in the apartment, take him the spot, push his face near the accident, spank him once on the behind and admonish him verbally. (Do not tap his behind so hard that it injures him — just firmly enough that he realizes he did something wrong. Don't prolong the punishment. If you're crate-training him — meaning putting him in a crate or cage temporarily as a "time-out" — remember that, after 20 minutes, he won't remember why he's in there.)
Be sure to clean the spot and erase his scent.
And take him outside in case he has more to deposit.