Can "O" apply to both "he" and "she?" If so, how can you determine which one it is
"O" is both he and she. There is no way to distinguish and this is not of grammatical importance in Turkish. They don't even think about it.
A similar example would be "ils" and "elles in French. They distinguish "they" for a group of woman and for a group containing any number of men. This is not important in English, naturally :)