It was reckoned unto him for righteousness (elogisqh ei dikaiosunhn). First aorist passive indicative of logizomai, old and common verb to set down accounts (literally or metaphorically). It was set down on the credit side of the ledger "for" (ei as often) righteousness. What was set down? His believing God (episteusen twi qewi).