две is used for feminine nouns.
двa is used with masculine nouns.

Then the nouns are put into the genitive singular case.