We have 5 children. My kids used to walk all over me and only listen to my husband. My husband actually taught me how to get them to respect me more.
You mentioned that you live with your mother, does your son obey her? Kids can sense who the authority figure is as soon as they step into a room. This is why they listen to the men. If your mother is not placing you as the authority over your son, this could be your problem. But, if he sees you disrespecting her, and she is in a place of authority, you could be setting a bad example for him and teaching him it's okay to disrespect your mother. Kids are smart.
Also, you need to show him consistency in your discipline method, what ever it is. The same thing needs to happen for the same offence every time, even if you're too tired or you think it's cute. Kids will walk all over weak people, especially mothers. Children respect those who they know are in charge and those they can rely on. If he knows what to expect from you, he will change his behavior. Hitting a child is NEVER okay. A couple of swats on the butt for a dangerous act or for downright willfull disobedience, is a different story. But, spanking has to be done consistently but not for every offence, but it has to be always for the same offence. I mean if lying is worthy of a spanking, it has to be done everytime the child lies. The same with every other form of discipline. A spanking has to be done without being angry and with lots of love.
If one of my children doesn't do what is expected of them, or if they are not minding, or throwing a tantrum, they are immediately picked up and put in their room on their bed and the door is closed. This is not a time out, usually just a wake up call that they can't continue to do that.
Everyone is a critic, and because you're young they will all try to tell you what to do. I had twins at 19 and everyoen thought they knew better than me. I listened and took the advice of those who had children, and those who had well behaved children. My oldest girls are now 11, and are two of the sweetest most well behaved children I know.
A two year old is testing you. He wants you to show him you are the boss and that you love him. He wants you to show him you can and will take care of him.
Oh, one more thing. Whenever any of our children are showing signs of trouble, misbehaving, disobeying, tantrums etc, we give that child extra attention. Extra alone time and more love and hugs. This we have found, helps tremendously, a lot of times kids will act out when they aren't getting enough positive attention.
Good luck.