Peter spelled out, in no uncertain terms, that there are two conditions. Those two conditions are the same that Jesus spelled out at the beginning of His Gospel—repent and believe. No one can be rightly baptized unless he believes.
So, we see him fulfilling those conditions. Baptism is an ordinance symbolizing faith in the death, burial, and resurrection of Christ.
The purpose of Jesus' baptism was to set us an example. He was put down into the water, for He went up out of the water. Both Philip and the eunuch went down into the water. There was no reason for Philip to go actually into the water, except for the reason there was no other way he could plunge the eunuch into the river. "They came up out of the water together" is the way that it is worded.