You may place your compost pile in the sun or the shade, but the sun will accelerate the composting process.
The sun helps raise the temperature, allowing bacteria and fungus to function more quickly. It also means that your pile will dry out more quickly, which is especially important in hotter southern areas.
If you decide to put your pile in the sun, keep it wet while it heats up.