...I count the lines and spaces...
You can't answer the question completely just by counting the number of lines and spaces. That will only give you one part of two needed to answer the question.
You need to get the basic interval number first: third, fifth, sixth, etc. Then you need to determine the specific quality of the interval.
Counting lines and spaces - which is just going through the gamut of letters A to G - will give you the basic interval class. Given
G A B C D E F we go up to the seventh position to get from
F so it is a seventh of some quality.
Getting the specific quality is a bit tricky. Technically it is determined by the exact size of the interval in half steps. A minor seventh is 10 half steps. A major seventh is 11 half steps.
In practice I think people use a number of shortcut strategies to identify intervals rather than count half steps.
One way is to know the intervals within keys. In
C major the given tones
F are the dominant and subdominant and the interval between those two is a minor seventh. In fact all sevenths in a major key are minor except between the tonic and the leading tone above (Do and TI in solfege) and the subdominant and and mediant above (FA and MI).
There are other basic interval facts like: in a major key thirds on the tonal degrees (DO, FA, SOL) are major while all others are minor, or all fifths are perfect except between FA and TI.
Understanding inversion is a helpful aid. Third invert to sixth, fifths to fourths, etc. Inversion changes major to minor and visa versa, but perfect remains perfect. You can use that in connection with knowing the half step size of small intervals like minor seconds (one half step) and major seconds (two half steps.) If you invert
F you have
G a major second (two half steps) which upon inversion flips major to minor and second to seventh. It's a minor seventh.
Another trick is to work relative to some know interval. An octave shortened by one half step is a major seventh, shortened by two half steps it's a minor seventh.
F natural is two steps down from the octave above therefore it's a minor seventh.
All that knowledge comes with time so just keep identifying intervals.