When God created man he created him upright, or righteous, fully capable of freely choosing between good and evil:
Ecclesiastes 7:29, KJV
29 Lo, this only have I found, that God hath made man upright; but they have sought out many inventions.
But they have sought out many inventions; and so begins man’s dilemma!
Thomas Boston in Human Nature in Its Fourfold States, page 37ff, expounds on the nature of man as created by God:
“God hath made man upright. By ‘man’ here we are to understand our first parents; the archetypal pair, the root of mankind, the compendized world, and the fountain from which all generations have streamed; as may appear by comparing Genesis 5:1,2, In the day that God created man, in the likeness of God made he him: male and female created He them; and blessed them and called their name Adam. ..... In this sense, man was made right [agreeable to the nature of God, whose work is perfect], without any imperfection, corruption, or principle of corruption, in his body or soul. He was made ‘up-right,’ that is, straight with the will and law of God, without any irregularity in his soul. By the set it got in its creation, it directly pointed towards God, as his chief end; which straight inclination was represented, as in an emblem, by the erect figure of his body, a figure that no other living creature partakes of. What David was in a gospel sense, that was he in a legal sense; one ‘according to God's own heart’, altogether righteous, pure, and holy. God made him thus: He did not first make him, and then make him righteous, but in the very making of him, He made him righteous. Original righteousness was created with him; so that in the same moment he was a man, he was a righteous man, morally good; with the same breath that God breathed into him a living soul, He breathed into him a righteous soul.”
God made a special place, a garden called Eden, in which this first man and his wife would live. There God would fellowship with this first family. When God placed Adam and Eve in Eden He gave instructions as to their responsibility.
Genesis 2:15-17, KJV
15 And the LORD God took the man, and put him into the garden of Eden to dress it and to keep it.
16 And the LORD God commanded the man, saying, Of every tree of the garden thou mayest freely eat:
17 But of the tree of the knowledge of good and evil, thou shalt not eat of it: for in the day that thou eatest thereof thou shalt surely die.
Because God created man righteous he had the ability to to keep God’s instructions perfectly, even in the face of temptation. He also had the ability to freely choose between good and evil.
We do not know how long the blessed fellowship continued between God and the first family, Scripture does not indicate. We do know from the above Scripture that man, body and soul, physically and spiritually was created to be immortal. Thomas Boston, page 38, comments sadly on the ruin of this first family.
“But they have sought out many inventions. They fell off from their rest in God, and fell upon seeking inventions of their own, to mend their case; and they quite marred it. Their ruin was from their own proper motion: they would not abide as God had made them; but they sought out their inventions, to deform and undo themselves.”
Man rebelled against God; Eve yielded to temptation, Adam sinned with deliberate intent [Genesis 3: 1-6]. John Gill comments on the Apostle Paul’s description [1 Timothy 2:14] of Adam’s transgression as follows:
“There is no need to say with interpreters, that he was not deceived first; and that he was not deceived immediately by the serpent, but by Eve; and that he is never said in Scripture to be deceived, as Melchizedek is never said to have a father or mother. The apostle's positive assertion is to be taken without any such limitations or qualifications; Adam never was deceived at all; neither by the serpent, with whom he never conversed; nor by his wife, he knew what he did, when he took the fruit of her, and ate; he ate it not under any deception, or vain imagination, that they should not die, but should be as gods, knowing good and evil. He took and ate out of love to his wife, from a fond affection to her, to bear her company, and that she might not die alone; he knew what he did, and he knew what would be the consequence of it, the death of them both; and inasmuch as he sinned wilfully, and against light and knowledge, without any deception, his sin was the greater: and hereby death came in, and passed on all men, who sinned in him.”