The way I see it, you have 3 options:
- Request a 30-day Office 365 trial
With Office 365, you can have access to the latest SharePoint version without needing your own infrastructure. You can also email O365Dev at microsoft.com and ask for a developer subscription and they may give you a one-year Enterprise edition of Office 365.
- Setup and/or download an existing SharePoint 2010/2013/2016 Virtual Machine
2013 is the last version to have a free edition, SharePoint Foundation. You can grab this, or find a Server VM online. There used to be a couple but now most of them are broken links. There is also a 2016 trial available.
You can also look for free software (e.g. Windows Server) through MSDN/DreamSpark programs, specially if you are a student.
- Try installing SP in Windows
There are a couple of hacks to allow you to install and develop on a non-server windows operating system, but it could be a bit complicated and involves editing the registry, etc., so I would think of this only on a worse case scenario.
Are there any SharePoint virtual machines available from Microsoft?
Installing Sharepoint 2013 Windows 7
Is there a free version available in SharePoint 2016?