The correct answer is: in.
The preposition “in” is used to indicate a period of time during which something happens. In this case, the speaker is indicating that the person was in prison for a period of three years.
The other options are incorrect because they do not accurately convey the meaning of the sentence. The preposition “over” is used to indicate a period of time that is greater than a specific amount. In this case, the speaker is not indicating that the person was in prison for a period of time that was greater than three years. The preposition “about” is used to indicate a period of time that is approximately a specific amount. In this case, the speaker is not indicating that the person was in prison for a period of time that was approximately three years. The preposition “of” is used to indicate a period of time that is a part of a larger period of time. In this case, the speaker is not indicating that the person was in prison for a period of time that was a part of a larger period of time.