"Do you have a pencil?"
Both mean "do you have a pencil", but using 持つ specifically asks whether they have a pencil on them at the moment, whereas ある asks whether they have a pencil in general. If you have a pencil at home but you aren't carrying it with you, then only ある would apply, not 持つ.
duolingo keeps using particle を for situations of possession, where i could've sworn i learned we were supposed to use が when show possession, such as "i have a pencil"
The use of を and が has no direct association with possession. Perhaps you can quote an example in Japanese to explain your idea.
You're confusing the two verbs used for "have".
鉛筆を持っています。- I have a pencil (on me at this moment).
In this sentence, the pencil is the direct object. It is being possessed directly by the subject (which is commonly elided due to previous context). を is therefore the correct particle.
鉛筆があります。- I have a pencil (but I may or may not be carrying it).
This time, the pencil is the subject of the sentence. They are literally saying "there is a pencil". That is why が is used here.
I got it right cuz I figured what the app was trying to do, but wouldn't you just say "あなたわえんぴつありますですか？" why is that not the way to go? Thanks
The sentence you wrote is full of mistakes. The particle is written as は, you need a particle before verbs, in this case between えんぴつ and あります, です is only used in noun sentences, ある is a verb so you only need ありますか. So the correct sentence would be "あなたはえんぴつがありますか。", though you don't really need to use "あなた" in this context since it's obvious who you're talking to. And they can both work, though ありますか can also mean "is there".
あります only refers to "there is" something somewhere but not as far as "to have" something. If you consider a person as a spatial location ありますcan be used, e.g. at/on a body part, there is something. Don't forget the に particle.
ある can mean "to have", but 持つ specifically means "to have (on one's person)" or "to carry", whereas ある is a more general "have", while also meaning "to be" or "to exist". You could say both "鉛筆を持っています" and "鉛筆があります", but you couldn't say "家を持っています" unless you were literally carrying your house in your arms. So if that's not the case, then you would have to say "家があります" to say "I have a house".
It should be noted that ある can only be used for non-living objects. If you want to say "I have a child" or "I have a dog", then you would need to use いる. "犬がいます".