It's not a matter of residency but of proper jurisdiction and venue under the Uniform Child Custoy Jurisdiction and Enforcement Act. According to Wikipedia, which seems to have a pretty good summary:
The UCCJEA vests "exclusive [and] continuing jurisdiction" for child custody litigation in the courts of the child's "home state," which is defined as the state where the child has lived with a parent for six consecutive months prior to the commencement of the proceeding (or since birth for children younger than six months). If the child has not lived in any state for at least six months, then a court in a state that has (1) "significant connections" with the child and at least one parent and (2) "substantial evidence concerning the child's care, protection, training, and personal relationships" may assume child-custody jurisdiction. If more than one state has "significant connections" and "substantial evidence...", the courts of those states must communicate and determine which state has the most significant connections to the child. A court which has made a child-custody determination consistent with UCCJEA has exclusive, continuing jurisdiction over the determination until either (1) that court determines that neither the child, the child's parents, nor any person acting as a parent has a significant connection with the State that made the original order and that substantial evidence is no longer available in the State concerning the child's care, protection, training, and personal relationships, or (2) that court or a court of another State determines that the child, the child's parents, and any person acting as a parent do not presently reside in the State that initially made the child custody order."
You can see that because you've lived in SC less than six months, the answer regarding which state would be best to file in, and when to file, is not actually "cut and dry". Either state could exercise jurisdiction, if needed. But once that state exercises jurisdiction, it retains it and the other state will only hear the case in the future if you jump through more procedural hoops showing that you no longer have contacts with the home state. So, choose carefully. Which state do you anticipate will have the longest relationship with your child? Are you going to leave SC in six months and return to the other state? Will there be any witnesses needed, and where do they reside? Do you already have an attorney in the other state who is familiar with your case and situation? Will custody be contested? Would jurisdiction be contested?
This is not legal advice and does not create an attorney client relationship. This is for information only. You should discuss this with an attorney in person prior to making any decision about how and when to proceed.
Sign up to receive a 5-part series of useful information and advice about child custody law.