Counterpoint is a style of writing that uses multiple independent melodic lines playing at the same time. It might seem that any music that has multiple parts is a type of counterpoint given this definition. However, the emphasis is on lines which are both independent and melodic, not just any lines.
What makes a line independent? The main features that define a melody are rhythm and contour. When two lines have different rhythms, i.e., happen at different times, and different contours, i.e., move in different directions, they are truly independent.
In example 1, both lines move in the same direction and have the same rhythm so they are not independent, even though they are playing different notes.
In example 2, the lines move in opposite directions but have the same rhythm. there independent in terms of contour but not independent in terms of rhythm.
In example 3, the lines move in the same direction but have different rhythms. They our independent rhythmically, but not in terms of direction.
In example 4, the lines move in opposite directions and have different rhythms. Therefore they are totally independent.
A question arises: When writing counterpoint do the lines need to be independent all the time? The answer is no. Independence means they are not tied to one another. They are free to differ, but it times they may also agree.
Although not mandatory contrary or oblique motion is always preferred over parallel motion.