Open your friends list and change your status to Offline, and that should be what you need.
You can't do it for specific friends, but if you're just trying to play solo that will do the trick.
gaming.stackexchange.com/users/11047/Decency
Click "add non-steam game" then add something like notepad.
You can then rename it whatever you want to make it less suspicious.
Run it from steam and it will show you as in a non-steam game called whatever you decide to name it.
Then run the game you actually want to play and your status will remain in the non-steam "game" you launched first.
gaming.stackexchange.com/users/46806/NightCrest
Edit :
As of 2018-04-10 there is a built-in setting to hide your currently played game in Profile >
Edit Profile >
My Privacy Settings > Game details .
Set this to Private, but take note of the other profile items affected by this setting.
Since it would hide so much of your profile, this old answer may still be useful:
You can maintain a "blue" online status while playing a Steam game.
This method requires multiple instances of Steam.
For example, sign into the same Steam account on 2 different machines.
Set your status to Offline in the instance you'll play your game from, and set the other instance's status to whatever you want your friends to see.
gaming.stackexchange.com/users/154598/Skull Kid
Steam → Settings → uncheck Automatically sign into Friends when I start Steam It actually should keep the Steam trolls from harassing you.
gaming.stackexchange.com/users/83380/user83380
Yes, it is possible.
All you have to do is to block them:
You might want to look at this question too to be clearer, but basically it makes you appear as "offline" to that person only.
However, like that post says, be careful because they can still see your real status if they go to your profile, whether they're logged in or not.
If you're concerned about it, one counter is to set your profile as private to everyone, or just do like other answers say and set your status to Offline.
gaming.stackexchange.com/users/118/Ullallulloo
Since a recent update, you can now set it so that only your friends, or no-one can see what you're playing.
Go to the Steam community settings page here, it can be found at that link or as this answer states, on Steam go to Profile >
Edit Profile >
My Privacy Settings > Game details At Game Details
you can choose between public, friends only or private.
This category includes the list of all games on your Steam account, games you’ve wishlisted, your achievements and your playtime.
This setting also controls whether you’re seen as "in-game" and the title of the game you are playing.
gaming.stackexchange.com/users/97591/Reaces
To play online without anyone seeing (I know even people who are your friends can get annoying with requests when you just want to play alone), right click your profile pic in steam when you're not in game and set it to offline.
You can still play online but it wont show that little notification to your friends.
I use it all the time
gaming.stackexchange.com/users/86400/SteamNinja
You can set your status to offline after you join the game with someone.
So there will be a minute or so window where they will be able to see what you are doing so not really a perfect solution.
gaming.stackexchange.com/users/41577/Severious
I have the solution after needing to be hidden as well.
At the top of your steam window should be several options, steam view friends games help.
Click on the friends option and a drop-down menu should appear.
From there you can click on whatever status you would like.
This allows you to be "offline" while still being able to play and you don't have to block anyone.
gaming.stackexchange.com/users/56476/Krystawista
Is there any way to prevent others from seeing your Steam status without removing them as a friend?   Let's say I want to play Borderlands 2 without letting some friends know. Is there any way to hide my status to prevent them from knowing I'm playing it?  Basically, what I'm asking if Steam has an "Appear Offline" option.
Is there any way to hide your Steam status from others?
gaming.stackexchange.com
<steam>
gaming.stackexchange.com/questions/94211
gaming.stackexchange.com/users/18916/korrasaur
You can change your status to Offline so no one can see you're playing. There are plenty of client options to follow, in order to hide your status in Steam.
The community suggests few options regarding hidding your status in Steam.