如何让OR(||)和AND(&&)语句一起工作? PHP

I can't get this code to work

if ($title != 'Main' || $nSpace == 56 || $nSpace == 30 && $ifHome != 361)

So i settled for this code

if ($title != 'ArticleCategories' || $nSpace == 1)
    if ($nSpace == 0 && $ifHome != 1)

So, i am now wondering how can i get those two lines into one line in the way so that it works? I know how to get multiple or || statements into one line but not the or || and and && statements together.

Use parens to group the logic together in a manner that makes sense for your program.

if ($title != 'Main' || $nSpace == 56 || ($nSpace == 30 && $ifHome != 361))