Is Afghanistan considered a border of India?

Even though it never touches it. I was thinking "Yes" but I don't quite understand.

No, Afghanistan does not border India. Since it doesn't touch India, it can't possibly be consider to be bordering it.

However, before India won its independence from the United Kingdom, it included Pakistan. During those years (until 1947), British India bordered Afghanistan.