Please explain when to use dwa or dwie??
yes
For 2, the basic form "dwa" is used with masculine nonpersonal nouns (dwa psy, dwa domy) and with most neuter ones (dwa drzewa). "dwie" is for feminine nouns (dwie kobiety),