Seal a backup drain from sewer gas?
The ordinary P trap is required to be used, as I'm quite sure that you live in an area covered by ordinary plumbing codes.
A Trap Filler AKA Trap Primer and/or a floor drain seal may also be required to protect the trap seal.
https://codes.iccsafe.org/content/IPC2018/chapter-10-traps,-interceptors-and-separators#IPC2018_Ch10_Sec1002.4
IPC 1002.4 Other codes will be similar.