Here's another solution that's fairly easy to generalize. It's based on this helper function:
function: ROLL:n replace FILTER:s with REROLL:d {
if ROLL = FILTER { result: REROLL }
result: ROLL
}
Using this function, we can generate a bunch of custom dice:
X: [d6 replace 1 with 2]
Y: [d6 replace {1..3} with d6]
Z: [dY replace 1 with 2]
…and roll three of each of them:
output 3d6 named "3d6"
output 3dX named "3d6, count 1 as 2"
output 3dY named "3d6, reroll 1-3 once"
output 3dZ named "3d6, reroll 1-3 once, count 1 as 2"
The output, graphed, looks like this:

(Note that it doesn't matter in this case whether we first reroll the d6, and then replace 1s with 2s, or vice versa — either way, both natural 1s and 2s get rerolled once and then counted as 2. I could've just as well written Z: [dX replace {2..3} with dX]
and gotten the exact same results. More generally, e.g. if you wanted to count 1s as 2s only on the first roll, it could matter. Also, as Medix2 points out in the comments, in general replacing some rolled numbers with others could change which numbers are worth rerolling. In this case, however, it doesn't.)