"Automatically" is an assumption here that can not be made.  First, if the parents of the child were never married then the Mother is considered under the law to be only legal guardian.  The Father has to establish parentage - that he is the father - and then make an application to the court for custody.  The reasons behond why the other child is in foster care have not been given here but if the pacement was possibly made to insure the safety and well being of the child then maybe that could bolster your request for custody.  Good luck.