Yep.
The free trial doesn't have a time limit, so feel free to take your time. There are some restrictions which you can see here.
They roll previous expansions into new ones, so when Endwalker launches it will include Shadowbringers and Stormblood.
When upgrading to the full version from the trial you will still need to buy the base game (Starter Edition) before you can apply expansion codes to your FFXIV account. The Complete Edition (A bundle of the starter edition + expansions) is often the better purchase (keep in mind that the current Complete Edition does not include Endwalker).