"and his mother". Is mom your child? Is the child in question your grand child? I ask, because blood relation can make all the difference here.
The child is my son but I'm not the real father but he has been with me since he was born
Keep in mind that the IRS looks at things "literally" when it comes to taxes. So if you are not the real father, he can't be your son unless you went through the formal adoption process. That's how the IRS sees it. Now here's some things that matter, and I ask this stuff because there are so many possible scenarios, I'd have to write a book to cover them all. So lets see what specifically applies to your situation.
Where is the mother and father of the child? Generally they get first dibs on their children when it comes to taxes. As a non-blood related relative to the child, you are last in line. So this really matters.
You say he "lived with me and *his mother*" Are you married to his mother? Is she just your girl friend? Is that his biological mother? If the latter, why is she not claiming the child on her tax return? Maybe she didn't work at all in 2017? Maybe the biological father has the right to claim him under a divorce decree? This "can" get deep, and if you claim him and your claim is not legal because of other legal agreement that does not involve you, then you can potentially find yourself in some pretty deep kim-chee. So all this needs to be known.
Mother lives with me and father lives in the state were we are but mother did not want father to know anything do to specific reason of her own and she is working but I make more then she does and she is my girlfriend
Were the biological parents of the child ever married? Does there exist any type of divorce decree, separation agreement, or custody agreement or any court order of same or similar, in which that child is named?
You cannot claim the child because the child is not related to you and did not live with you the entire year (only 9 months).
Even if the child did live with you the entire year, you could only claim the child if the mother was not required to file tax return because the child would then be her Qualifying Child that would prevent you from claiming an unrelated child, even if she choose not to claim him.
The father could only claim the child exemption if the mother (the custodial parent) chooses to release the exemption to him with a signed 8332 form. Only a court order could compel her to do so.