In order to get custody of a child (as a non-parent), you have to prove that it would be significantly detrimental to the child's well-being to be placed in the care of either of his natural parents. This can be a difficult standard to achieve, but it really depends on the circumstances, including the status of both of the child's parents. Legal guardianship is another option (if you have the consent of the parents). I'd recommend you speak with an attorney as soon as possible to discuss your options.
** This response is provided as general information only and does not constitute legal advice or otherwise establish an attorney client relationship. **
Sign up to receive a 3-part series of useful information and advice about child custody law.