A goal can be scored from anywhere on the pitch, even an opposing team's goal kick can count as a goal if it goes in. There are a few scenarios where a goal cannot be allowed - if a ball goes in from a throw-in without touching a player it cannot stand as a goal. If a goal is scored from an indirect free kick without being taken as such, it does not count.
To be counted as a goal, the entire ball needs to cross the goal line, in between the two posts and underneath the crossbar.
Chat with our AI personalities
As long as the ball crosses the line. For example, when your Mom was scoring a goal on me, it was disallowed because the ball didn't cross the line.
Sources(s): Personal Experiences