Answer: Both. A McKinney-Vento student can have more than one school of origin in a school year. School of origin is defined in the McKinney-Vento Act as “the school that a child or youth attended when permanently housed or the school in which the child or youth was last enrolled, including a preschool.” This is in the law in section 722(g)(3)(I).
In the example you gave, both school A and school B can be schools of origin, if school A is the school the child attended when permanently housed, and school B is the school in which the child was last enrolled.
This definition of school of origin is helpful in responding to situations where children and youth are highly mobile, and may not realize that they can return to the school that they were attending when permanently housed (or the school in which they were last enrolled).