The first one is more natural if you are referring to an action that was in progress at 8 o'clock. But it is not possible to omit the subject in English, pronoun "I" in this case.
If you are referring to an action that was concluded before 8 o'clock, you should use Past Perfect and a different preposition, "by 8 o'clock" in this case.
E.g.: I had finished my homework by 8 o'clock last night.
Both sentences are syntactically incorrect, i.e. the word order is not respected.
You have two options: 1) to use a comma for emphasis: At 8 o'clock last night, I was doing my homework; 2) to put the whole adverbial phrase after the object: I was doing my homework at 8 o'clock last night.
i would change them to ...
I did my homework yesterday at 8 o'clock - to indicate a finished action. (Someone asks you: When did you do your homework?)
I was doing my homework yesterday at 8 o'clock - to indicate action in progress (someone asks you: what were you doing yesterday at 8?)