While there are comprehensive definitions of subject, they won't apply to every language. Some languages use a topic-comment structure instead, such as Japanese.
Most communication is intended to convey propositions to the listeners. Propositions generally start with a piece of known information, and then add a new piece of information. Sometimes the new information is communicated through nouns or adjectives (such as John is a man or John is tall) and sometimes through verbs (John is running.) In all three of these examples John is the topic, and in English John is in the subject position.
The contrasting position is usually called the object. Transitive sentences will have both a subject and an object (John kicked the ball.) In these cases John has the role of actor, while the ball has the role of undergoer. But roles do not always correspond to the same grammatical position. In passive sentences the undergoer becomes the subject (The ball was kicked.)
So for these reasons you can't always identify the subject based on the meaning of the sentence. But you can identify it based on factors such as:
- Case - some languages have case for all nouns, but English only has it for pronouns. I is nominative and only appears in the subject position, while me is accusative, and does not appear in the subject position (usually. Let's not get into this discussion, but sentences like this will often be made by many native English speakers: John and me are going to the beach)
- Verb agreement - in many languages the verb will agree with the subject. In English we say I was jumping and They were jumping. In some languages though the verb is also marked for the object!
- Syntactic position - in many languages the subject must appear in a fixed position. In English it is before the verb. But there are other constructions which can change it around, such as Left-dislocation: The girl, the dog bit.