Learn Hebrew/Syntax/The earth is the subject
The earth is the subject
Name הָאָרֶץ as the subject of הָיְתָה.
Which word is the subject
הָיְתָה means was, said of a feminine noun. The noun that matches it is הָאָרֶץ, the earth. Darkness and the deep come later. They are not the subject of this verb.
The earth was
The noun stands before the verb. The ending of the verb matches the earth.
The verb takes her ending
הָיְתָה is feminine. It is looking back at the earth, not forward at the deep.
Check
Which word is the subject of הָיְתָה?
Why is the verb feminine?
Is תְהוֹם the subject of הָיְתָה?