He believed Yahweh
This means he accepted and trusted what Yahweh said was true.
he counted it to him as righteousness
"Yahweh counted Abram's belief as righteousness" or "Yahweh considered Abram righteous because Abram believed him"
I am Yahweh, who brought you out of Ur
Yahweh was reminding Abraham of what he had already done so that Abraham would know that Yahweh had the power to give Abram what he promised him.
to inherit it
"to receive it" or "so that you will possess it"
how will I know
Abram was asking for more proof that Yahweh would give him the land.