Relevant rule:
Rule 69 – Interference on the Goalkeeper
69.1 Interference on the Goalkeeper - This rule is based on the premise that an attacking player’s position, whether inside or outside the crease, should not, by itself, determine whether a goal should be allowed or disallowed. In other words, goals scored while attacking players are standing in the crease may, in appropriate circumstances be allowed (refer to Rule 69.7 for example). Goals should be disallowed only if: (1) an attacking player, either by his positioning or by contact, impairs the goalkeeper’s ability to move freely within his crease or defend his goal; or (2) an attacking player initiates intentional or deliberate contact with a goalkeeper, inside or outside of his goal crease. Incidental contact with a goalkeeper will be permitted, and resulting goals allowed, when such contact is initiated outside of the goal crease, provided the attacking player has made a reasonable effort to avoid such contact. The rule will be enforced exclusively in accordance with the on-ice judgement of the Referee(s), but may be subject to a Coach’s Challenge (see Rule 38).
For purposes of this rule, “contact,” whether incidental or otherwise, shall mean any contact that is made between or among a goalkeeper and attacking player(s), whether by means of a stick or any part of the body.
The overriding rationale of this rule is that a goalkeeper should have the ability to move freely within his goal crease without being hindered by the actions of an attacking player. If an attacking player enters the goal crease and, by his actions, impairs the goalkeeper’s ability to defend his goal, and a goal is scored, the goal will be disallowed.
If an attacking player has been pushed, shoved, or fouled by a defending player so as to cause him to come into contact with the goalkeeper, such contact will not be deemed contact initiated by the attacking player for purposes of this rule, provided the attacking player has made a reasonable effort to avoid such contact.
If a defending player has been pushed, shoved, or fouled by an attacking player so as to cause the defending player to come into contact with his own goalkeeper, such contact shall be deemed contact initiated by the attacking player for purposes of this rule, and if necessary a penalty assessed to the attacking player and if a goal is scored it would be disallowed.
69.3 Contact Inside the Goal Crease - If an attacking player initiates contact with a goalkeeper, incidental or otherwise, while the goalkeeper is in his goal crease, and a goal is scored, the goal will be disallowed (refer to Rule 69.7 for an exception).
If a goalkeeper, in the act of establishing his position within his goal crease, initiates contact with an attacking player who is in the goal crease, and this results in an impairment of the goalkeeper’s ability to defend his goal, and a goal is scored, the goal will be disallowed.
If, after any contact by a goalkeeper who is attempting to establish position in his goal crease, the attacking player does not immediately vacate his current position in the goal crease (i.e. give ground to the goalkeeper), and a goal is scored, the goal will be disallowed. In all such cases, whether or not a goal is scored, the attacking player will receive a minor penalty for goalkeeper interference.
If an attacking player establishes a significant position within the goal crease, so as to obstruct the goalkeeper’s vision and impair his ability to defend his goal, and a goal is scored, the goal will be disallowed.
For this purpose, a player “establishes a significant position within the crease” when, in the Referee’s judgment, his body, or a substantial portion thereof, is within the goal crease for more than an instantaneous period of time.