حَضَرَ اثْنَانِ.
Translation: Two men attended. اثْنَانِ is a nominative subject with alif.
رَأَيْتُ اثْنَيْنِ.
Translation: I saw two men. اثْنَيْنِ is an accusative object with yāʾ.
حَضَرَتِ اثْنَتَانِ.
Translation: Two women attended. اثْنَتَانِ is a nominative subject with alif.
سَلَّمْتُ عَلَى اثْنَتَيْنِ.
Translation: I greeted two women. اثْنَتَيْنِ is genitive with yāʾ.