Title. The steam GUI when I right click on them only shows Rust options, nothing for Terraria. The Terraria server works and I was in it, left for a second, and now I can't join back, due to them opening Rust. The friend is now AFK and in the future I would like to be able to join their game while they have Rust or another game open. How can I make it so I see the option to join their Terraria world while they are playing Rust?
You can't do anything to make Terraria joinable when your friend is playing Rust. Steam allows you to join game sessions relatively easily when your friends are playing the same game (ie. you're both playing Terraria, or both playing Rust). However, if you are playing Terraria, and your friend is playing Rust, then you cannot join what does not exist in Steam's eyes.
Your friend would need to set up a dedicated Terraria server that runs your shared world, which you would connect to in-game via an IP address, rather than Steam's "Join Game" feature.