A player is offsides if he is in the attacking zone (the attacking zone is the area inside of the opposing team's blue line) before the puck enters. This prevents players from "cherry picking," or waiting in the offensive zone for a long a pass from outside of the zone. Maybe I am not explaining this well enough, so look at this little diagram below:
There are essentially 3 zones on a hockey rink, the offensive zone (where the other team's goal is located), the neutral zone (the middle of the ice, the space between both blue lines) and the defensive zone (where your goal is located).
Now, assume that your net minder is in the goal at the bottom of the page, and your team is carrying the puck "up" to the other team's side of the ice. Say you are carrying the puck. You cannot cross the other team's blue line until all of your team's players are outside of the opposing team's defensive zone. Does that make sense?
In summary, you cannot cross the blue line while on offense before the puck has entered the zone (crossed the blue line).
Like in soccer, you are not allowed to be behind the last defender before the ball is. In hockey you are not allowed to be beyond the blue line before the puck is.
Also, many of the members here are from North America, meaning a 5+ hour time difference about...