Step mom needs advice. Help!

My 15 year old stepson has been living with us since November of last year. He didn't really know his dad ( my husband) all that well due to the mom alienating him from us for years. They finally started trying to build relationship with each other late 2013 when my husband found him on Facebook. The mom found out and told my husband that he should not talk to his son then blocked him. In 2014 she reach out on Facebook saying that the son needs a quality male figure in his life and so on. They started off with 2 to 3 hour visits then soon progressed to weekends. A few months later his mom started to flake on the visits which lead my stepson to start acting up and flunking in school. She then started the visits again and decided she would leave it up to my husband and the son. Fast forward a few months later and the mom said to keep him after what was supposed to be a weekend visit. She told us to come get his belonging and school transfer papers and he permanently moved in with us. She didn't come to see him for 7 plus months. She finally came on his birthday ( early June) and bought him a brand new phone without our consent(he has had a porn addiction which we are trying to break and she knows about it). She picked him up yesterday, for how long? We don't know because she only communicates with him , not me or my husband. Since he has been here , he skipped 5 classes in 7 months and his grades started to suffer . He's had all computer privileges taken from him due to porn and his grades, except for the cell he got from mom(he doesn't have our WiFi password). He is rude to both me and his dad , disrespectful too. He has a very nasty attitude which would make anyone just want to stay away from him. He can't have a decent conversation with anyone without be a jerk. He talks to adults like he is an adult too and he talk down to people. He doesn't want anyone to correct him and he keeps using the fact that his dad wasn't around as an excuse to be the way he is. He manipulates and plays both side because his mom and his dad doesn't communicate. Whenever his dad tries to communicate with his mom about issues with him the blame games always comes up. This past weekend I was by my friend, starting from Friday evening. Saturday we had a BBQ to go to so my husband dropped my stepson at the BBQ and came to pick me and my friends up. When I got there I said hi to my step son but he gave me the cold shoulder, my friend even asked if he didn't like me. My husband picked me up on Sunday night, when we got home I said good evening to him and he totally ignored me. Monday morning I got up and made us all breakfast, he was on the couch sleeping at the time. He woke up and came to the kitchen to get his breakfast, no good morning to me but he said it to his dad. Later in the day I asked him to do the dishes so I can get started on lunch. He started to roll his eyes and pout so I went into the kitchen and asked what was wrong. He told me he knows that I don't like him so he will not talk to me. I asked why he thought that , he said it's the way I look at him . He then asked who I saw when I looked at him , if I saw his mom, him or his dad?.He then proceeds to say he feels ignored by everyone one. This is a kid who sits in his room all day and when I try to go talk to him or get him to come downstairs he say he wants to be alone. We have to beg him to go out with us and he would not talk to any of the kids his age where we go to. He says he don't like people. He hardly talk to us in or out the house. After the kitchen incident I approach him and told him how I felt , he started to cry and so did I, I was so hurt because I treat this kid like he is my own. I try to talk to him so he won't feel alone ( he is always nasty to me but I just never learn) , teach him how to cook, clean , bake, do laundry etc so he can grow up to be an independent young man. I even play video games with him. I try to correct him when he is wrong, teach him politeness etc but this is what I get?. What am I doing wrong? (Sorry for the long message but I had to give some background information ) Any advice on how to proceed with him would be much appreciated. Thanks