There is a version of Minecraft that you can play directly through your browser for free: Minecraft Classic. With this, you will own Minecraft and can download and play whenever you want. You can buy Minecraft: Java Edition from the Minecraft Wesbite for $26,95. On PC the trial allows users to play on a single world for a 100 minute period before the map is locked or reset. The length of the trial depends on the device.
The Minecraft free trial is available on Windows 10, Android and consoles.
There is no legal way to play Minecraft for free after the trial is over. If you want to continue playing after your trial has finished, you will need to pay. You can initially play Minecraft's free trial.