There is no way to get free games to stick in your library if they are not installed as far as I know.
gaming.stackexchange.com/users/19827/kotekzot
As a workaround, you can list all free-to-play games that you have played before (i.e. that you have added to your library): Go to Steam Library Filters website.
This is a third-party website made by Lorenzo Stanco .
Input your Steam numeric ID, or profile name, or profile URL.
In other words, just follow the instructions on the site.
Make sure your profile is public, otherwise the website cannot list your games.
Wait until it loads the list of all your games.
Filter games by Free to Play tag.
This solution only works for games that are correctly tagged as Free to Play on the Steam Store page.
It should work for the most popular ones.
gaming.stackexchange.com/users/1552/Denilson Sá Maia
You cannot keep them in your library if you haven't downloaded them as others say but you can view a list of all the free/Free to play games that you added at any point in time to your account directly from steam without using any third party services as suggested in some of the answers.
From there you can go to their respective store page and redownload them.
Login to your account on Steam Client Click on your user Profile (Shown as 1) Click on Games (Shown as 2)
In there, select "All Games" tab.
It will show all the games that you have bought or were Free/Free to Play.
You will be able to click on them, go to store page and download them back into your library.
The URL, in case you prefer Web Browser instead of client, to that page is: https://steamcommunity.com/id/[your username here]/games/?tab=all
gaming.stackexchange.com/users/101298/NSNoob
The first thing to mention is that when you open the Steam website and open a free game you "own", it actually shows that it is in your Game Library.
So, it is unlikely that F2P games are counted as "owned" except when you have them installed.
Also, recently I was forced into deleting everything from my Steam folder except the steamapps and userdata folders and Steam.exe itself.
Still, all my free-to-play games were there, even the ones I've never installed and played.
So, I can assume, that if @kotekzot is right, then the files mentioning all those F2P games should be in those two folders.
I've conducted a search through them using Magicka:
Wizard Wars with an ID 202090 as an example.
Actually, I've found nothing related to this game, not a single file, neither in steamapps folder nor in userdata .
Still, as I mentioned, the game is present on my account, so I have totally no idea where the file that mentions this game could be.
So, summarizing all this: I think this issue can't be resolved without further research.
gaming.stackexchange.com/users/21595/Mugi4ok
This problem seems to be Team Fortress 2 specific.
I have several other free games in Steam that work just fine.
See the screenshot for some example titles.
The bold games are currently installed.
The others are not.
gaming.stackexchange.com/users/239261/cyberixae
I added the Free-To-Play Team Fortress 2 to my favorite games in the Steam library, and played the game.  After reinstalling steam, the game went missing from the library completely - it does show up in neither favorites nor recently played games.  All other games work perfectly fine. I am logging in to the correct account and did not mess around with Steam in any way.  I can still install/play the game by going to its store page, but that's cumbersome. Is there any way to fix this?
Free to play games go missing in the Steam library
gaming.stackexchange.com
<steam>
gaming.stackexchange.com/questions/107550
gaming.stackexchange.com/users/168/mafu
You can't get free games to stick in your library if you have downloaded them.  In order for a free game to appear in steam libray, it has to be installed.
It seems that free games do not stay in the steam library persistently. However a user is saying that this problem happens with a specific game.