The rule is that if the net is displaced, the goal doesn't count. However, if the net is ruled to be deliberately displaced by the goalie or another player on his team, the ref can count the goal.
When there's a break, I'll look up the rule about the net being knocked off. As I remember, a goal can be scored if a player from the opposing team knocks it off.