Since I have all girls...I never had the issue come up of marking until I started fostering little Yorkie

boys.
I quickly discovered the fantastic "belly-band" which is just a strip of material that you adhere a panti-liner (l found in the women's personal hygiene section at your grocery store) and the band wraps around the girth of their abdomen just covering the "weinie" fastened with velcro.
Both my fosters were young so, it was easy to train them not to mark but, if I had to do it without the belly band...I'd only foster females.
Good luck on your new apartment and you can master this problem with being consistent on correction & praise & definitely limit your lil' guys space!