Awhile: an adverb meaning, for a time. Or literally, for a while.

Example: Go play awhile.

**In this sentence you can swap out the adverb with another, such as: quietly. Go play quietly.

A while: a noun meaning, for a length of time.

Example: Go play for a while.

**In this sentence you can swap out the noun with a length of time, such as: ten minutes. Go play for ten minutes.