There isn’t a specific way to ensure that your strawberries are very sweet. Think of when you get a punnet from the grocery store; different strawberries from the same plant can taste slightly different.
That said, it is the sun that develops the sugar in the strawberries. So try to position your strawberries somewhere with good sun coverage. That said, strawberries can actually do well in the shade, so don’t worry if you don’t have a backyard or don’t have a backyard with a lot of sun coverage.