Did we all stand before God in spirits form before birth to attest to faith?
The first part of the question is correct. It is mentioned in the Qur’an that God held all mankind, prior to their arrival in this world, and accepted their acknowledgement of His Lordship as the only God in the universe. The Qur’anic verse states:
"Your Lord brought forth their offspring from the loins of the children of Adam, and called them to bear witness about themselves. (He said): ‘Am I not your Lord?’ They replied: ‘yes, indeed, we bear witness to that.’ (This He did) lest you should say on the Day of Resurrection, ‘We were truly unaware of this;’ or lest you say, ‘It was our forefathers who, in times gone by, associated partners with God, and we were only their late offspring. Will You destroy us on account of what those inventors of falsehood did?’" (Al-A’araf"7:172-173)