The referee must not signal simply because a player is in an offside position, but must look for active involvement. In other words, the referee must “wait and see.”
Furthermore, if an referee is in any doubt as to whether a player is in an offside position or if a player in an offside position is actively involved in play, the referee must decide in favor of the attacker and refrain from signaling offside. To phrase it slightly differently: When in doubt, give the benefit of that doubt to the attacker. The referee, too, must be certain that there is active involvement before deciding for offside.