Jesus answers the question of loyalty in Luke 2. When asked about his whereabouts, Jesus answers that dealing with His heavenly Father’s business was more important than dealing with his earthly father’s business. As Green observes:
Luke has staged this interchange so as to pinpoint the primary issue, Who is Jesus’ father? To whom does he owe primary allegiance? Jesus; aligning himself with God’s aim comes to the fore especially through the use of the expression “it is necessary”—employed regularly throughout Luke-Acts as an indicator of salvation-historical necessity (NICNT, 156).
Familial claims–though important–do not take precedence over the claims of the Father.