.
This is what a book written by Mary Embree says in her 2013 book ABUSED, CONFUSED, AND MISUSED WORDS. I was able to read it at Google "Books."
A While (two words) = a period of time. So we should write "He had to wait a while for the bus" and "It has been a while since they've seen each other."
Awhile (one word) = for a short time. So we should say "Please stay awhile."
P.S. Many native writers do NOT agree on the use of those words.