need advice about dog

Autumn • My beautiful son born 5/26/19 💙🥰❤️😍
So I have a one and a half year old dachshund and for the life of me he won't be house broken. I will stand outside with him for 20 minutes he'll pee several times and then come right in the house and lift his leg on EVERYTHING sometimes he actually pees and other times he doesn't. I'm very annoyed with it and as we are renting I want to get my deposit back and not ruin the apartments carpeting. 
I need some advice or we're going to have to rehome him which I would HATE to do. 
TIA