Defining ungrammatical is much more problematic. An ungrammatical sentence is one where the order of the words makes the sentence impossible to understand. We see this all the time on this site when non-native English speakers write in word-for-word translations of their native language. Modern linguists know that native speakers are incapable of creating ungrammatical sentences. Even the most profoundly mentally handicapped individual would never utter a sentence like "Shoes myself tied I by."
A sentence like, "We ain't never done seen nothing like that there," is not ungrammatical because every native English speaker knows exactly what it means. It is, however, non-standard because it violates some of the rules of the dialect called Standard English. The sentence does not violate any of the rules of the native English dialect in which it is spoken; therefore, it is grammatical.