Both words have many different meanings, but I imagine you are referring to something like the following:
As you are from Chile, you speak Spanish.
While he is living in the US, he does not speak English.
Here, the two words have opposite meanings. “As” sets up a logical cause-effect relationship, while “while” sets up a contrast — a relationship that is the opposite of what we would expect. In my last sentence, we could replace “while” with “but” for a similar, though stronger, contrast. In my first example with “while”, we could replace “while” with “although” (or “even though”) for a similar, if somewhat stronger, contrast.
By the way, the sentence “While he lives in the US, he does not speak English” could conceivably have an entirely different interpretation, depending on the context. “While” could possibly mean “during the time that”. “As” can also be used this way. For example, “he whistles as he works” and “he whistles while he works” both have the same meaning and are grammatically correct, although I wouldn’t necessarily choose either of those phrasings. Also note that “he whistles as he works” has another possible interpretation — it could mean that his manner of whistling is the same as his manner of working: “He whistles as he works — poorly.”
Conclusion: Mostly pay attention to the beginning of this post, where I explained how the two words can have opposite meanings.