Always best to visit your local office if the INSS social security. Though the law on healthcare is national, we find offices differ in documents needed.
Residency should be applied for the child first.
If you work as employed or self-employed Autonomo, you are entitled to register your child as your dependant / beneficiario.
If you do not, then you need to apply under the ´bajos recursos´ scheme as all minors are entitled to free healthcare. All documents and form to complete to apply for healthcare under the ´bajos recursos´/ low income scheme can be found on this LINK
Children either the libro de familia or birth certificate where the name of the insured person should figure. Can be either parent.
Health card of the insured parent.
Application form on link or other if INSS demand.
Note: in case you meet with resistance or even refusal to register a minor for healthcare under the ‘bajos recursos’ scheme, please consult the info from THIS topic on the website as all children in Spain, under the Ley de Menor, have a right to free healthcare, whether they can produce the correct paperwork or not.