You have your logic the wrong way around. You said (edited):
now let us take this example if i said "i have less high schools in my area than your area" by following the grammar high schools is non-count but far as i know it is a count noun
Yes, it is a count-noun, and by following the text you cited from your book, you would incorrectly conclude that it is a non-count noun. That is because the book says "if you can use many ...." and "if you can use much ..." etc. The book should have said "if you must use ..."
So you set up your example with incorrect usage of "less." The example was grammatically incorrect, so when you applied the rules from the book, you got an incorrect answer.
The example should have been "I have fewer high schools in my area ..." and if you had applied the book rules to that, you would have correctly concluded that it is a count noun.
To answer your question, the way to tell the difference is: does it make sense to apply a count to the noun?
High school. We have three high schools. You have one high school. Makes sense, so: Count noun. (Correct: You have fewer high schools than we do.)
Energy. We have three energy. You have one energy. Doesn't make sense, so: Non-count noun. (Correct: You have less energy than we do.)