Maryland Family Law Section 9-303
§ 9-303.
  (a)   This section applies if there is a conflict between a custody order of a court of this State and a custody order of a court of another state.
  (b)   Except as provided in subsection (c) of this section, a custody order of a court of this State prevails over a custody order of a court of another state.
  (c)   A custody order of a court of another state prevails over a custody order of a court of this State if the court in the other state passed its custody order:
    (1)   after the custody order was passed by a court of this State; and
    (2)   in proceedings in which the lawful custodian under the custody order of a court of this State:
      (i)   consented to the custody order passed by the court of the other state; or
      (ii)   participated personally as a party.