Let's start at the beginning. Your a flat dweller, a problem from the start.
How easy is it for the pup or any dog to get outside from inside your flat? I haven't understood the 'geography' of this. The pup is still young yet.Are you with the pup all the time? The price of Liberty carpets is eternal vigilence ! You have to be alert to all the signs that the pup is about to urinate or defecate. The fastest movement known to dogdom is between the old handler seeing the first sign and scooping the pup up and putting it outside (whereupon the pup, surprised, promptly does nothing, but patience is required because it will eventually) When the result is achieved, the handler praises the pup.
Now, you may say you get no warning, but you do unless the pup is very young."Outside" is a bit much if it would involve carrying the pup down seven flights of stairs; both of you would have forgotten why you're outside. So, if hampered in this way, you carry the pup to a sheet of newspaper, or fancy training mat, always set in the same place, instead, and praise with "Good boy/girl !!!" on performance. The pup will eventually learn to perform only in the one place; that's when the approval is gained, and will tend to go there again, particularly if it can also smell the spot as one used before (not essential, but helpful).
With time pups gain more bladder control. That's when on seeing any sign you can walk the dog outside. It prefers to perform on grass (or lamp posts) anyway; that's nature. When it sees that you put it outside, in walks or just on a sign, it will start to indicate that wish by looks and moves to the door.