So I'm new to the Pokemon TCG, atleast when learning how to play the game itself. I've gotten confused to what distinguishes EX and GX cards. I looked it up and all I found was that GX are majorly basic cards that can be played without the need of evolving it, for quick turnarounds. Ex on the other hand need to be evolved into from a basic card, so planning is necessary. However I need help with the tournament rules, so If I'm right only 1 EX is a allowed. I don't know if EX and GX follow the same rules. This is mainly because I want a lucario and M Lucario (M Lucario is only EX). I want to use a Lucario GX and a Mega Lucario EX, is that allowed, or do I need Riolu, a normal Lucario, then a M. Lucario EX? I ask this because I don't want to accidently get used to just for fun rules, then to have my cards be pulled as tournament illegal, and have to make a new deck all over again. Thanks for the help :D
The only things needed to know the rules of a particular card are just a rulebook and the card itself.
Regarding EX cards, there's nothing written on them about limiting them to one per deck so this rule from rulebook applies:
When you are building a deck, you can have only 4 copies of a card with the same name in it, except for basic Energy cards.
Also the text "Evolves from X" on Evolution cards (= not Basic) is important because it's the name of the card you can only play the Evolution card onto. In your case, Lucario-EX is Basic, M Lucario-EX is Mega evolution that "Evolves from Lucario-EX" so you only need Lucario-EX in play to be able to evolve to M Lucario-EX, any other combination won't work.
In the rulebook there are appendices for both Pokémon EX and Mega Pokémon explaining the rules that are written on the cards if you'd like to know more.
In tournament, as long as you have at least one Basic Pokémon card in your deck, you can't be punished for playing an impossible evolution cards (like Riolu+Lucario with M Lucario-EX), you would just have cards in your deck that you are not able to play under any circumstances (you can't put M Lucario-EX into play without Lucario-EX). On the other hand, don't forget to check the actual format of the tournament, all premier events nowadays use either Standard format (cards released in last ~24-36 months) or Expanded (Black & White and newer) and your M Lucario-EX is legal only in the latter one. If you showed with M Lucario-EX on a Standard event, than you would really have an illegal deck.
As you pointed out, the difference between Pokémon EX and Pokémon GX is that the former ones are always Basic whereas the latter ones are always the stage they are supposed to be (except for Tag Team GX cards which are also always Basic). However this difference is conceptual and has no impact on the game itself. You just read the cards and you are fine.