We normally use the to refer to transportation methods that run on a fixed route, as in
I took the bus to school.
I took the subway to work.
I took the shuttle to the hotel.
We are not really talking about an individual bus but rather a means of getting from one place to another. The same can be said for I took the elevator to the fifth floor. When we want to refer to an individual bus, shuttle, or elevator, we can use either a/an or the depending on whether we think the listener knows which one we are talking about. If so, we would normally use the.
And we use a (an) to refer to transportation methods that do not run on a fixed route:
I took a taxi to John's house.
I took a limousine to the theater.
For school and home see
What's the difference between "go", "go to", and "go to the"?.
There is no easy way to determine when you use which article. Many uses are idiomatic and must be learned one at a time. Just expose yourself to more and more native English in natural contexts. Article usage and use of prepositions are two of the most difficult aspects of English for learners to master.